--------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/07_output/logs/1_prep_an
> d_geolocate_addresses.log
  log type:  text
 opened on:   3 Mar 2024, 10:05:59

.         
.         // list dofiles in alphabetical order (saved in local files)
.         local files : dir "$do_path/1_prep_and_geolocate_addresses/" files "*.do"

.         local files: list sort files

.         macro list _files
_files:         "01_import_ltw18_single.do" "02a_import_btw09.do" "02b_import_ltw13.do"
                "02c_import_kow14.do" "02d_import_btw17.do" "02e_import_ltw18.do"
                "02f_import_euw19.do" "02g_import_kow20.do" "03_geocode_ltw18.do"
                "04_voter_panel.do" "05_prep_polling_stations.do" "06_geocode_polling_stations.do"
                "07_correction_polling_stations.do" "08_merge_voter_polling_stations.do"
                "09_export_for_arcgis.do"

.         // run dofiles
.         foreach f of local files {
  2.                 di "Running: `f'"
  3.                 do "$do_path/1_prep_and_geolocate_addresses/`f'"
  4.         }
Running: 01_import_ltw18_single.do

. /*
> Input: LTW2018_Straßenverzeichnis_einzeln_mit Filter.xlsx
>                 > raw excel file comprising full electoral roll of 2018 state election (SE-18 / 
> LTW18)
>                 including voters' home addresses
> 
> Output: $tmp/strassen_prep_ltw18_single.dta
> 
> Main task:
>         > the comprehensive list of addresses will serve as reference for geocoding
>         > clean street names for geocoding and for merge with electoral rolls from other electio
> ns
>         > addresses are identified by merge_strasse (harmonized street name) and nummer (address
>  number)
>         
> */
. 
. 
. * READ: Excel file containing home addresses, SE-18 (156,261)
.         import excel "$rawdata/election_office/electoral_rolls/LTW2018_Straßenverzeichnis_einzel
> n_mit Filter.xlsx", firstrow clear
(7 vars, 156,261 obs)

.         
. *rename
.         ren             STRASSE strasse

.         ren             HNr hnr

.         ren             BUCHSTABE buchstabe

.         ren             PLZ plz

.         ren             STIMMBEZIRK sb_

.         ren             STIMMKREIS wahlkreis_ltw18

.         ren             STADTBEZIRK stadtbez

.         lab var stadtbez "city district"

.         
. * generate number of the address containg also letters (e.g., 6 + a -> 6a)
.         tostring hnr, replace
hnr was int now str3

.         gen     nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * keep only necessary variables: street, number, district
.         drop hnr buchstabe plz sb_ wahlkreis_ltw18

.         
. * Clean street names for geocoding 
.         //harmonizing apreviations and comon words with different possible spellings
.         replace strasse = subinstr(strasse,"St.","Sankt",.)
(692 real changes made)

.         replace strasse = subinstr(strasse,"Südl.","Südliche",.)
(0 real changes made)

.         replace strasse = subinstr(strasse,"Alle","Allee",.)
(1,060 real changes made)

.         replace strasse = subinstr(strasse,"Alleee","Allee",.)
(978 real changes made)

.         replace strasse = subinstr(strasse,"pl.","platz",.)
(1,900 real changes made)

.         replace strasse = subinstr(strasse,"Pl.","Platz",.)
(913 real changes made)

.         replace strasse = subinstr(strasse,"str.","straße",.)
(89,124 real changes made)

.         replace strasse = subinstr(strasse,"Str.","Straße",.)
variable strasse was str32 now str35
(43,384 real changes made)

.         replace strasse = subinstr(strasse,"straße","strasse",.)
(89,124 real changes made)

.         replace strasse = subinstr(strasse,"Straße","Strasse",.)
(43,384 real changes made)

.         
.         //correct typos
.         replace strasse="Allensteiner Strasse" if strasse=="Alleensteiner Strasse"
(12 real changes made)

.         replace strasse="Allescherstrasse" if strasse=="Alleescherstrasse"
(70 real changes made)

.         
. * Harmonize street names 
. *       gen merge_strasse := harmonized street names
.         gen     merge_strasse = strasse

.         lab var strasse           "cleaned street name for geocoder"

.         lab var merge_strasse "harmonized street name for merging"

.         
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(129 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(9 real changes made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(32,671 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(156,197 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(22,666 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(0 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(57 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(3,748 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(4,527 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(6,143 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(6,948 real changes made)

. 
. 
. * generate city variable for geocoding
.         gen     stadt = "München"

.         lab var stadt "city name for geocoder"

. 
. * save
.         isid merge_strasse nummer       

.         save "$tmp/strassen_prep_ltw18_single.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_prep_ltw18_single.
    > dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_prep_ltw18_single.
    > dta saved

. 
end of do-file
Running: 02a_import_btw09.do

. /*
> Input: BTW2009-Strvz-alph-Stadtb.xlsx
>         > electoral roll 2009: raw addresses of all eligible voters and their assigned precincts
> 
> Output: tmp/strassen_btw09_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and identify street segments that are assigned to a given precinct 
>                         -> a segment is equal to a streetname + range of numbers (e.g., Mystreet
>  6-18)
>                 >> note: a maximum number is not always given (e.g., singletons and "from 6 onwa
> rds" cases) 
>                         -> we generate max numbers by hand (e.g., 6 -> 6-6 and "from 6" -> 6-320
>  (hypothetical max))
>                 
>         > from street segments extend data to include each single address (e.g., Mystreet 6, Mys
> treet 8, etc.)
>                 -> several cases to be considered:
>                 0. streets without any numbers // not the case in 2017
>                  . address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
>                 1. beginning and ending of address contain only numbers and no letters (e.g., 1-
> 15)
>                  If segments with letters, different cases:
>                         2. only beginning of the segment contains a letter (e.g., 16a-24)
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                         If segments contain letter at the beginning and the ending, different ca
> ses:
>                         4. assignment given for exactly one address (same street and same letter
> ), e.g. 16a-16a
>                         5. assignment given for exactly one street (but with different addresses
>  (letters)), e.g. 17b-17e
>                         6. first and second mentioned address contain letter and both have diffe
> rent numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging // very similar to 2013
. ************************************************************************
. 
. ** PULL: Raw 2009 electoral roll; import column by columns
.         tempfile col_1 col_2 col_3 col_4 

. 
.         import excel using "$rawdata/election_office/electoral_rolls/BTW2009-Strvz-alph-Stadtb.x
> lsx", clear cellrange(A1) 
(12 vars, 3,761 obs)

.         keep A C

.         rename A street_tmp

.         rename C sb

.         save `col_1'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format

.          
.         import excel using "$rawdata/election_office/electoral_rolls/BTW2009-Strvz-alph-Stadtb.x
> lsx", clear cellrange(D1) 
(9 vars, 3,761 obs)

.         keep D F

.         rename D street_tmp

.         rename F sb

.         save `col_2'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format

.         
. 
.         import excel using "$rawdata/election_office/electoral_rolls/BTW2009-Strvz-alph-Stadtb.x
> lsx", clear cellrange(G1) 
(6 vars, 3,761 obs)

.         keep G I

.         rename G street_tmp

.         rename I sb

.         save `col_3'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format

. 
.         import excel using "$rawdata/election_office/electoral_rolls/BTW2009-Strvz-alph-Stadtb.x
> lsx", clear cellrange(J1) 
(3 vars, 3,761 obs)

.         keep J L

.         rename J street_tmp

.         rename L sb

.         save `col_4'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format

. clear 

.         
.         forvalues j = 1/4 {
  2.                 append using `col_`j''
  3.         }

.         missings dropobs, force

Checking missings in street_tmp sb:
4 observations with missing values

(3 observations deleted)

.         
.         replace sb = subinstr(sb, " ", "", .)
(3,165 real changes made)

.         lab var sb "raw precinct id"

.         
.         
. 
. ** Identify and clean addresses 
.         /* Excerpt of the column 'strasse' => goal is to extract Street names and segments
>         
>         S t a d t b e z i r k
> 
>         Adelgundenstr.                  <- street name 
>         1  -   3   unger.               <- street segment 
>         2  -   4   gerade
>         ab       5   fortl.
>         Albertgasse                             <- street name 
>         Alexandrastr.
> 
>         */
. 
. * Drop empty rows and 'Stadtbezirk' label 
.         replace         street_tmp = subinstr(street_tmp, " ", "", .)
(14,366 real changes made)

.         drop if street_tmp == ""
(656 observations deleted)

.         drop if street_tmp == "Stadtbezirk" // district
(25 observations deleted)

. *       drop tmp*
. 
. * Identify whether an entry references street segment; save in separate variables
.         gen tmp = ustrregexm(street_tmp,"(ab)?[0-9]")

.         
.         // gen strasse1 := raw street name 
.         gen     street = street_tmp if tmp==0
(7,943 missing values generated)

.         
.         // fill up empty rows with street names
.         replace street = street[_n-1] if missing(street)
(7,943 real changes made)

.         
.         // gen hnr_orig_segment := street segment
.         gen     hnr_orig_segment = street_tmp if tmp==1
(6,417 missing values generated)

.         drop tmp* street_tmp

.         
. * Drop redundant entries
. *       (when multiple segments are listed; street name spans mult. rows & precinct id is empty 
> => drop these rows)
.         drop if missing(sb)
(2,510 observations deleted)

. 
. * generate district ID
.         gen     stadtbez = substr(sb, 1, length(sb)-2)

.         lab var stadtbez "city district ID"

. 
. * clean some (long) street names (checked manually)
.         replace street="Hildegard-von-Bingen-Anger"     if street=="Hild.-v.-Bingen-Ang."
variable street was str24 now str26
(1 real change made)

.         replace street="Rondell Neuwittelsbach"                 if street=="Rond.Neuwittelsbach"
(3 real changes made)

.         replace street="Franz-Josef-Strauß-Ring"               if street=="F.-J.-Strauß-Ring"
(3 real changes made)

.         replace street="Hedwig-Dransfeld-Allee"                 if street=="Hedwig-Dransfeld-A."
(2 real changes made)

.         replace street="Karl-Amadeus-Hartmann-Weg"              if street=="Karl-A.-Hartmann-Weg
> "
(1 real change made)

.         replace street="Mies-van-der-Rohe-Str."                 if street=="Mies-van-der-Rohe-St
> "
(1 real change made)

.         replace street="Geschwister-Scholl-Pl."                 if street=="Geschw.-Scholl-Pl."
(1 real change made)

.         replace street="Walter-Klingenbeck-Weg"                 if street=="Walter-Klingenbeck-W
> "
(1 real change made)

.         replace street="Heinrich-Stieglitz-Kehre"               if street=="Heinr.-Stiegl.-Kehre
> "
(1 real change made)

.         replace street="Jean-Paul-Richter-Str."                 if street=="Jean-Paul-Richter-St
> "
(2 real changes made)

.         replace street="Hermann-von-Sicherer-Str."              if street=="Herm.v.SichererStr."
(1 real change made)

.         replace street="Christoph-Rapparini-Bogen"              if street=="Christ.-Rapparini-Bg
> "
(1 real change made)

.         replace street="Werner-Friedmann-Bogen"                 if street=="Werner-Friedmann-Bg"
(1 real change made)

.         replace street="Friedenheimer Brücke"                  if street=="FriedenheimerBrü."
(2 real changes made)

.         replace street="Johann-Sebastian-Bach-Str."     if street=="Johann-Seb-Bach-Str."
(1 real change made)

.         replace street="Maximilian-Wetzger-Str."                if street=="Maximilian-Wetzger-S
> "
(2 real changes made)

.         replace street="Nördliche Auffahrtsallee"              if street=="Ndl.-Auffahrtsallee"
(3 real changes made)

.         replace street="Nördliches Schloßrondell"             if street=="Ndl.-Schloßrondell"
(1 real change made)

.         replace street="Rainer-Werner-Fassbinder-Pl."   if street=="R.-W.-Fassbinder-Pl."
variable street was str26 now str28
(1 real change made)

.         replace street="Südliche Auffahrtsallee"               if street=="Südl.Auffahrtsallee"
(3 real changes made)

.         replace street="Südliches Schloßrondell"              if street=="Suedl.Schloßrondell"
(1 real change made)

.         replace street="Am Hartmannshofer Bächl"               if street=="AmHartmannsh.Bächl"
(0 real changes made)

.         replace street="Ehrenbreitsteiner Str."                 if street=="EhrenbreitsteinerSt"
(3 real changes made)

.         replace street="Jakob-Hagenbucher-Str."                 if street=="Jak.-Hagenbucher-Str
> "
(1 real change made)

.         replace street="Moosacher St.-Martins-Pl."              if street=="MoosachSt-Martins-P"
(2 real changes made)

.         replace street="Christoph-von-Gluck-Pl."                if street=="Christ.-von-Gluck-Pl
> "
(4 real changes made)

.         replace street="Erwin-von-Steinbach-Weg"                if street=="Erw.v.-Steinbach-Weg
> "
(1 real change made)

.         replace street="Martin-Luther-King-Weg"                 if street=="Mart.Luther-King-Weg
> "
(1 real change made)

.         replace street="Werner-Seelenbinder-Weg"                if street=="W.-Seelenbinder-Weg"
(1 real change made)

.         replace street="Alois-Wolfmüller-Str."                         if street=="Alois-Wolfmue
> ller-St"
(1 real change made)

.         replace street="Christoph-Probst-Str."                  if street=="Christ.-Probst-Str."
(1 real change made)

.         replace street="Elisabeth-Selbert-Str."                 if street=="Elisabeth-Selbert-St
> "
(1 real change made)

.         replace street="Freimanner Bahnhofstr."                 if street=="FreimannerBahnhofst"
(1 real change made)

.         replace street="Heinrich-Geißler-Str."                         if street=="Heinr.-Geißle
> r-Str."
(1 real change made)

.         replace street="Karl-Köglsperger-Str."                         if street=="Karl-Köglsper
> ger-St"
(1 real change made)

.         replace street="Peter-Paul-Althaus-Str."                if street=="Peter-Paul-Althaus-S
> "
(1 real change made)

.         replace street="Werner-Heisenberg-Allee"                if street=="W.-Heisenberg-Allee"
(2 real changes made)

.         replace street="Adolf-Oberländer-Weg"                  if street=="Adolf-Oberländer-We"
(1 real change made)

.         replace street="Anschütz-Kaempfe-Str."                         if street=="Anschuetz-Kae
> mpfe-S"
(1 real change made)

.         replace street="Bernhard-Lichtenberg-Weg"               if street=="Bernh.-Lichtenberg-W
> "
(1 real change made)

.         replace street="Else-Lasker-Schüler-Str."              if street=="E.-Lasker-Schüler-S"
(0 real changes made)

.         replace street="Eugen-Kalkschmidt-Weg"                  if street=="Eug.-Kalkschmidt-Weg
> "
(1 real change made)

.         replace street="Friedrich-Herschel-Str."                if street=="Friedr.-Herschel-Str
> "
(3 real changes made)

.         replace street="Gertrud-von-Le-Fort-Weg"                if street=="Gertr.-v-Le-Fort-Weg
> "
(1 real change made)

.         replace street="Hugo-von-Hofmannsthal-Str."     if street=="H.-v.-Hofmannsthal-S"
(1 real change made)

.         replace street="Johannes-Neuhäusler-Str."              if street=="Joh.-Neuhäusler-Str"
(3 real changes made)

.         replace street="Marie-Luise-Kaschnitz-Str."     if street=="Marie-L.-Kaschnitz-S"
(0 real changes made)

.         replace street="Schnorr-von-Carolsfeld-Str."    if street=="Schnorr-v-Carolsf-St"
(1 real change made)

.         replace street="Wolfgang-Borchert-Weg"                  if street=="Wolfg.-Borchert-Weg"
(1 real change made)

.         replace street="Zur Deutschen Einheit"                  if street=="ZurDeutsch.Einheit"
(2 real changes made)

.         replace street="Johann-Michael-Fischer-Pl."     if street=="Joh.-Mich.-Fischer-P"
(1 real change made)

.         replace street="Anton-Geisenhofer-Str."                 if street=="Anton-Geisenhofer-St
> "
(2 real changes made)

.         replace street="Bürgermeister-Keller-Str."             if street=="Bürgerm.-Keller-Str"
(1 real change made)

.         replace street="Elisabeth-Mann-Borgese-Str."    if street=="Elis.-Mann-Borgese-S"
(1 real change made)

.         replace street="Elisabeth-zu-Guttenberg-Str."   if street=="Elis.-z-Guttenberg-S"
(1 real change made)

.         replace street="Friedrich-Creuzer-Str."                 if street=="Friedr.-Creuzer-Str"
(3 real changes made)

.         replace street="Georg-Kerschensteiner-Str."     if street=="G.-kerschensteiner-s"
(3 real changes made)

.         replace street="Herzogstandstr. (Gronsdorf)"    if street=="Herzogstandstr.-Grdf"
(1 real change made)

.         replace street="Maria-Montessori-Str."                  if street=="M.-Montessori-Str."
(2 real changes made)

.         replace street="Albert-Schweitzer-Str."                 if street=="Albert-Schweitzer-St
> "
(4 real changes made)

.         replace street="Arnold-Sommerfeld-Str."                 if street=="Arnold-Sommerfeld-St
> "
(3 real changes made)

.         replace street="Charles-de-Gaulle-Str."                 if street=="Charles-de-Gaulle-St
> "
(3 real changes made)

.         replace street="Dr.-Walther-von-Miller-Str."    if street=="Dr-Walth.-v-Miller-S"
(1 real change made)

.         replace street="Friedrich-Engels-Bogen"                 if street=="Friedr.-Engels-Bogen
> "
(1 real change made)

.         replace street="Gerhart-Hauptmann-Ring"                 if street=="Gerh.-Hauptmann-Ring
> "
(5 real changes made)

.         replace street="Gertrud-Kückelmann-Weg"                if street=="Gertr.-Kückelmann-W"
(1 real change made)

.         replace street="Hans-Pössenbacher-Weg"                         if street=="Hans-Pössenba
> cher-W"
(1 real change made)

.         replace street="Joseph-Maria-Lutz-Anger"                if street=="Jos-Maria-Lutz-Anger
> "
(2 real changes made)

.         replace street="Marieluise-Fleißer-Bogen"              if street=="Mariel.-Fleißer-Bog"
(1 real change made)

.         replace street="Maximilian-Kolbe-Allee"                 if street=="Maximil.-Kolbe-Allee
> "
(2 real changes made)

.         replace street="Peter-Lühr-Str."                               if street=="Peter-Luehr-S
> tr."
(1 real change made)

.         replace street="Stephanskirchener Str."                 if street=="StephanskirchenerSt"
(1 real change made)

.         replace street="Heinrich-Kröller-Str."                         if street=="Heinr.-Krölle
> r-Str."
(1 real change made)

.         replace street="Alpspitzstr. (Pullach)"                 if street=="Alpspitzstr.-Pullach
> "
(1 real change made)

.         replace street="Höllriegelskreuther Str."              if street=="Hoellriegelskr.Str."
(1 real change made)

.         replace street="Vinzenz-Schüpfer-Str."                         if street=="Vinzenz-Schüp
> fer-St"
(2 real changes made)

.         replace street="Holzapfelkreuther Str."                 if street=="HolzapfelkreutherSt"
(2 real changes made)

.         replace street="Ludwig-Wörl-Weg"                               if street=="Ludwig-Woerl-
> Weg"
(1 real change made)

.         replace street="Annelies-Kupper-Allee"                  if street=="Annelies-Kupper-Alle
> "
(1 real change made)

.         replace street="Philippine-Schick-Allee"                if street=="Philipp.-Schick-Alle
> "
(1 real change made)

.         replace street="Richard-Riemerschmid-Allee"     if street=="Rich-Riemerschmid-Al"
(1 real change made)

.         replace street="Am Aubinger Wasserturm"                 if street=="AmAubingerWassert."
(2 real changes made)

.         replace street="Centa-Hafenbrädl-Str."                         if street=="Centa-Hafenbr
> ädl-St"
(1 real change made)

.         replace street="Friedrichshafener Str."                 if street=="FriedrichshafenerSt"
(1 real change made)

.         replace street="Josef-Steinbacher-Weg"                  if street=="Jos.-Steinbacher-Weg
> "
(1 real change made)

.         replace street="Margarete-Kliemann-Weg"                 if street=="Marg.-Kliemann-Weg"
(1 real change made)

.         replace street="Walter-Schnackenberg-Weg"               if street=="Walt-Schnackenberg-W
> "
(1 real change made)

.         replace street="Albert-Pfretzschner-Weg"                if street=="Albert-Pfretzschn.-W
> "
(1 real change made)

.         replace street="Ernst-von-Romberg-Str."                 if street=="Ernst-von-Romberg-St
> "
(1 real change made)

.         replace street="Georg-Reismüller-Str."                         if street=="Gg.-Reismülle
> r-Str."
(1 real change made)

.         replace street="Nikolaus-Rüdinger-Str."                if street=="Nikol.-Rüdinger-Str"
(1 real change made)

.         replace street="Peter-Stegmüller-Weg"                  if street=="Peter-Stegmüller-Wg"
(1 real change made)

.         replace street="Auf den Schrederwiesen"                 if street=="Aufd.Schrederwiesen"
(5 real changes made)

.         replace street="Berthold-Litzmann-Str."                 if street=="Berthold-Litzmann-St
> "
(1 real change made)

.         replace street="Ignatius-Blenninger-Str."               if street=="Ignat.-Blenninger-St
> "
(1 real change made)

.         replace street="Ludwig-Gramminger-Str."                 if street=="Ludw.-Gramminger-Str
> "
(1 real change made)

.         replace street="Paula-Breitenbach-Weg"                  if street=="Paula-Breitenbach-Wg
> "
(1 real change made)

.         replace street="Steinröschenstr."                              if street=="Steinroeschen
> str."
(1 real change made)

.         replace street="Wilhelmine-Reichard-Str."               if street=="Wilhelm.-Reichard-S.
> "
(0 real changes made)

.         replace street="Johannes-Scharrer-Str."                 if street=="Johannes-Scharrer-St
> "
(1 real change made)

.         replace street="Friedrich-Brugger-Weg"                  if street=="Friedr.-Brugger-Weg"
(1 real change made)

.         replace street="Herzog-Albrecht-Anlage"                 if street=="Herzog-Albrecht-Anl.
> "
(1 real change made)

.         replace street="Johann-Karg-Straße (Haar)"             if street=="Joh.-Karg-Str.(Haar)"
(1 real change made)

.         replace street="Melitta-Bentz-Straße"                  if street=="Melitta-Benz-Str."
(0 real changes made)

.         replace street="Roßsteinstraße"                               if street=="Rosssteinstr."
(3 real changes made)

.         replace street="Wolfratshauser Straße (Pul)"   if street=="Wolfratsh.Str.(Pul)"
(1 real change made)

.         replace street="Jürgen-von-Hollander-Platz"    if street=="J.-v.-Hollander-Pl."
(1 real change made)

.         replace street="Karl-Heinrich-Ulrichs-Platz"    if street=="Karl-H.-Ulrichs-Pl."
(1 real change made)

.         replace street="Ludwig-Hilberseimer-Straße"    if street=="Ludw--Hilberseimer-S"
(1 real change made)

.         replace street="Magdalena-Bräu-Weg"                    if street=="Magdalena-Braeu-Weg"
(1 real change made)

.         replace street="Margarete-Schütte-Lihotzky-Straße" if street=="Mar.-Schuette-Lih.-S"
(0 real changes made)

.         replace street="Marianne-von-Werefkin-Weg"              if street=="Mar.-v.-Werefkin-W."
(1 real change made)

.         replace street="Maria-Goeppert-Mayer-Straße"   if street=="M.-Goeppert-Mayer-St"
(1 real change made)

.         replace street="Paul-Heyse-Unterführung"               if street=="Paul-Heyse-Unterfü."
(1 real change made)

.         replace street="Pfarrer-Rosenberger-Straße"    if street=="Pfarr.-Rosenberger-S"
(1 real change made)

.         replace street="Platz der Opfer des Nationalsozialismus" if street=="Pl-d-Opferd-Nat.Soz
> "
variable street was str28 now str39
(1 real change made)

.         replace street="Resi-Huber-Platz"                               if street=="RESI-HUBER-P
> L."
(0 real changes made)

.         replace street="Rudi-Hierl-Platz"                               if street=="RUDI-HIERL-P
> L."
(0 real changes made)

.         replace street="Schneiderhofstraße (Gronsdorf)" if street=="Schneiderhofstr.(GR)"
(1 real change made)

.         replace street="Schwester-Adelmunda-Weg"                if street=="Schwest.-Adelmunda-W
> "
(1 real change made)

.         replace street="Siegfried-Mollier-Straße"              if street=="Siegfr.-Mollier-Str."
(1 real change made)

.         replace street="Thomas-Theodor-Heine-Weg"               if street=="Thomas-Th.-Heine-Weg
> "
(1 real change made)

.         replace street="Wilhelm-Dörpfeld-Weg"                  if street=="Wilh.-Dörpfeld-Weg"
(1 real change made)

.         replace street="Wilhelm-Hausenstein-W."                 if street=="Wilh.-Hausenstein-W.
> "
(1 real change made)

.         replace street="Wolfgang-Früchtl-Straße"              if street=="Wolfg.-Früchtl-Str."
(1 real change made)

.         replace street="Gottfried-Koelwel-Weg"                  if street=="Gottfr.-Koelwel-Weg"
(1 real change made)

.         replace street="Alois-Johann-Lippl-Weg"                 if street=="Alois-Joh.-Lippl-Weg
> "
(1 real change made)

.         replace street="Sämannstraße (Gräfelfing)"           if street=="Saemannstr.(Graef.)"
(1 real change made)

.         replace street="Landaubogen"                                    if street=="Leonhard-Mol
> l-Bogen" // renamed by the city for historical reseason between 2014 and 2017
(1 real change made)

.         replace street="Ilse-Weber-Str."                                if street=="Paul-Lagarde
> -Str." // renamed by the city for historical reseason between 2014 and 2017
(2 real changes made)

.         replace street="Brunnthaler Weg"                                if street=="Friedrich-Be
> rber-Weg" // renamed by the city between 2014 and 2017
(1 real change made)

. 
. *Adjust street names for geocoding
.         replace street = subinstr(street, "Kard.", "Kardinal", .)     
(2 real changes made)

.         replace street = subinstr(street, "d.", "der", .)
(2 real changes made)

.         replace street = subinstr(street, "Alb.", "Albert", .)     
(10 real changes made)

.         replace street = subinstr(street, "b.", "burger", .)     
(2 real changes made)

.         replace street = subinstr(street, "-Bog", "Bogen", .)     
(54 real changes made)

.         replace street = subinstr(street, "B.", "Bogen", .)     
(1 real change made)

.         replace street = subinstr(street, "Br.", "Brücke", .)     
(2 real changes made)

.         replace street = subinstr(street, "Bog.", "Bogen", .)     
(0 real changes made)

.         replace street = subinstr(street, "Bogenen", "Bogen", .)     
(50 real changes made)

.         replace street = subinstr(street, "Wink.", "Winkel", .)     
(1 real change made)

.         replace street = subinstr(street, "A.", "An", .)     
(1 real change made)

.         replace street = subinstr(street, "-S.", "-Str.", .)     
(5 real changes made)

.         replace street = subinstr(street, "-Rg.", "Ring", .)     
(11 real changes made)

.         replace street = subinstr(street, "-Rg", "Ring", .)     
(11 real changes made)

.         replace street = subinstr(street, "v.", "von", .)     
(2 real changes made)

.         replace street = subinstr(street, "-v-", "von", .)     
(14 real changes made)

.         replace street = subinstr(street, "Wg", "Weg", .)   if  substr(street, strlen(street)-1,
>  2) =="Wg"
(1 real change made)

.         replace street = subinstr(street, "W.", "Weg", .)   if  substr(street, strlen(street)-1,
>  2) =="W."
(1 real change made)

.         replace street = subinstr(street, "W", "Weg", .)    if  substr(street, strlen(street), 1
> ) =="W"
(1 real change made)

.         replace street = subinstr(street, "wg", "weg", .)   if  substr(street, strlen(street)-1,
>  2) =="wg"
(0 real changes made)

.         replace street = subinstr(street, "P", "Platz", .)  if  substr(street, strlen(street), 1
> ) =="P"
(1 real change made)

.         replace street = subinstr(street, "St", "Straße", .) if substr(street, strlen(street)-1,
>  2) =="St"
(1 real change made)

. 
.         replace street="An der Streicherbreiten" if street=="A.d.Streicherbreiten"
(0 real changes made)

.         replace street="An der Hauptfeuerwache"  if street=="And.Hauptfeuerwache"
(0 real changes made)

. 
. 
. *Further change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(76 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(99 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(91 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(316 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(173 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,566 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(2,845 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,574 real changes made)

.         replace street = subinstr(street,"Straße","strasse",.)
(2,856 real changes made)

. 
.         replace street = street + "asse" if lower(substr(street, strlen(street)-2, 3)) =="str"
(115 real changes made)

.         replace street = street + "atz" if lower(substr(street, strlen(street)-1, 2)) =="pl"
(4 real changes made)

. 
.         replace street="Allensteiner strasse" if street=="Alleensteinerstrasse"
(1 real change made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(7 real changes made)

. 
.         
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

.         
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(7 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(42 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(11,844 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,798 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(306 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(319 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(413 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(531 real changes made)

.         
. * different from later years: segments not only defined by "-", but also by "from" ("ab"), "even
> " ("gerade"), "odd" ("unger."), "consecutive" ("fortl.")
.         gen even = strpos(hnr_orig_segment, "gerade")

.         gen odd  = strpos(hnr_orig_segment, "unger.") // no cases of "unger"

.         gen ab   = strpos(hnr_orig_segment, "ab")

.         gen fort = strpos(hnr_orig_segment, "fortl.") // no cases of "fort"

.         gen minus = strpos(hnr_orig_segment, "-")

.         
.         assert ab==1 | ab==0

.         assert even==0 & odd==0 if fort>0

.         assert even==0 & fort==0 if odd>0

.         assert odd==0 & fort==0 if even>0

.         assert fort==even==odd==0 if ab==0& minus==0

.         
. ** Extract address numbers from entries, e.g.,  '2-4gerade', 'ab26fortl.' etc.
. *       gen hnr_min / hnr_max := start number in given street 
. *       gen buchstaben_min /buchstaben_max := (optional) letter attachted to street number, e.g.
> , 44A 
. *       when whole street is assigned to a precinct, hnr_orig_segment is empty
. 
. * get starting number
.         * 'from' case
.         gen     hnr_orig_segment1 = substr(hnr_orig_segment, ab+2, .) if ab==1
(8,974 missing values generated)

.         
.         * "-" (minus) case"
.         replace hnr_orig_segment1 = substr(hnr_orig_segment, 1, minus-1) if ab==0
(4,380 real changes made)

.         
.         *"raw" case: only one number given
.         * note: this is different than in later year; it is possible that a singleton address is
>  stated (6 instead of 6-6)
.         replace hnr_orig_segment1 = hnr_orig_segment if ab==0 & minus==0
(687 real changes made)

.         
.         // assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment1)

. 
. * get ending number
.         gen hnr_orig_segment2 = substr(hnr_orig_segment, minus+1, .) if ab==0
(6,783 missing values generated)

.         
.         //assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment2) | ab==1

.         drop if hnr_orig_segment2 == "0" // drop if 0 is the number (does not exist)
(25 observations deleted)

. 
.         // assert: no common typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

. 
. * Impute "maximum" address number when not given
.         *singleton addresses: start=end (e.g., start and end = 22)
.         assert hnr_orig_segment==hnr_orig_segment1 if ab==0 & minus==0

.         replace hnr_orig_segment2 = hnr_orig_segment if ab==0 & minus==0
(0 real changes made)

.         
.         * when not specified, we assume the highest possible address number (320/321)
.         assert  missing(hnr_orig_segment2) if missing(hnr_orig_segment)

.         replace hnr_orig_segment2 = "320" if missing(hnr_orig_segment2) & even>0
(1,064 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & odd>0
(1,029 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & fort>0
(783 real changes made)

. 
. * extract address numbers from range specifications; (note this leave cases such as 44A)
.         // drop known strings
.         foreach c in "gerade" "unger." "fortl." {
  2.                 replace hnr_orig_segment1 = subinstr(hnr_orig_segment1,"`c'","",.)
  3.                 replace hnr_orig_segment2 = subinstr(hnr_orig_segment2,"`c'","",.)
  4.         }
(1,064 real changes made)
(1,462 real changes made)
(1,029 real changes made)
(1,508 real changes made)
(783 real changes made)
(1,410 real changes made)

.         
.         // extract numeric part (, e.g. drop A in 44A)
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,907 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,907 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
.         // extract letter attached to numbers (e.g., get A from 44A)
.         gen     buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,647 missing values generated)

.         gen     buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,282 missing values generated)

.         replace buchstaben_min=lower(buchstaben_min)
(178 real changes made)

.         replace buchstaben_max=lower(buchstaben_max)
(543 real changes made)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3907 missing values generated)
hnr_max: all characters numeric; replaced as int
(3907 missing values generated)

. 
.         // drop help variables
.         drop hnr_orig_segment1 hnr_orig_segment2

.         
. ************************************************************************
.  // 2. start generating addresses //
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace
(note: frame tmp not found)

. frame tmp {
. *case0: streets without numbers -> whole street belongs to precinct
.         keep if missing(hnr_orig_segment)
(7,918 observations deleted)
.         
. * keep variables
.         keep stadtbez sb merge_strasse
.         
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,250,240 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: assert _N==321
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(32,607,822 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,254,147 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,254,147 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,254,147 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,254,147 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,254,147 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,254,147 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,254,147 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,254,147 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,254,147 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,254,147 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,254,147 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,254,147 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,254,147 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,254,147 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,254,147 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,254,147 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,254,147 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,254,147 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,254,147 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,254,147 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,254,147 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,254,147 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,254,147 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,254,147 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,254,147 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,254,147 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,254,147 real changes made)
.         
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,907 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
. *addresses with high numbers and ab/from corrected manually
.         replace hnr_max = 337 if hnr_orig_segment=="ab333unger." & merge_strasse=="fuerstenriede
> rstrasse"
(1 real change made)

.         replace hnr_max = 425 if hnr_orig_segment=="ab365unger." & merge_strasse=="riemerstrasse
> "
(1 real change made)

.         replace hnr_max = 570 if hnr_orig_segment=="ab542gerade" & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 394 if hnr_orig_segment=="ab384fortl." & merge_strasse=="balanstrasse"
(1 real change made)

.         replace hnr_max = 386 if hnr_orig_segment=="ab340gerade" & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 391 if hnr_orig_segment=="ab345unger." & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 529 if hnr_orig_segment=="ab515unger." & merge_strasse=="landsbergerst
> rasse"
(1 real change made)

.         replace hnr_max = 443 if hnr_orig_segment=="ab400fortl." & merge_strasse=="feldmochinger
> strasse"
(1 real change made)

.         replace hnr_max = 667 if hnr_orig_segment=="ab641unger." & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 334 if hnr_orig_segment=="ab332gerade" & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         replace hnr_max = 345 if hnr_orig_segment=="ab335unger." & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         assert hnr_min<=hnr_max

. 
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(7,918 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(7,918 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(7,918 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(7,918 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(7,918 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(662 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. 
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * generate a variable containing how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * generate for each number a segment contains duplicates 
.         expand tmp1
(907,176 observations created)

.         drop tmp1

. 
. * generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(802,967 real changes made)

. 
. *some segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd>0 & mod(tmp3, 2) == 0
(162,773 observations deleted)

.         drop if even>0 & mod(tmp3, 2) == 1
(165,895 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
.         
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(21,233 observations deleted)
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(14,695,018 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(565,193 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(565,193 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(565,193 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(565,193 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(565,193 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(565,193 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(565,193 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(565,193 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(565,193 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(565,193 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(565,193 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(565,193 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(565,193 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(565,193 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(565,193 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(565,193 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(565,193 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(565,193 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(565,193 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(565,193 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(565,193 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(565,193 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(565,193 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(565,193 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(565,193 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(565,193 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(565,193 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(565,193 observations deleted)

. 
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(5,670 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(3,678 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(1,634 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1,695 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(327 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(22 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(404,638 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(420,201 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(205 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(15,418 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(15,529 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(15,549 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(15,560 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(15,560 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(15,562 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(15,562 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(15,562 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(15,562 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(15,562 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(15,562 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(15,563 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(15,563 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(15,563 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(15,563 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(15,563 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(15,563 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(15,563 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(15,563 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(15,563 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(15,563 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(15,563 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(15,563 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(15,563 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(15,563 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(15,563 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(15,563 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000008.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(15,758 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,183 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(1,088 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(722 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(119 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(50 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(57 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(41 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(73 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(13 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
variable tmp_buch was str1 now str2
(20 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(142,350 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(147,825 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(12,369 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(5,475 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(5,475 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,156 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,058 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,002 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(4,988 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(4,981 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(4,974 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(4,970 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(4,968 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(4,966 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(4,966 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(4,966 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(4,966 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(4,965 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(4,965 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(4,965 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(4,965 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(4,965 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(4,965 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(4,965 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(4,965 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(4,965 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(4,965 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(4,965 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(4,965 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(4,965 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000009.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(21,038 observations deleted)

.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(177 observations deleted)
.         gen buchstabe = buchstaben_min
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
. 
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000a.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(193 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(1 missing value generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(0 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1 real change made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(2 missing values generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(0 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(0 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(2 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(50 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==26)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         drop if buchstabe < tmp_buch
(2 observations deleted)
.         drop if buchstabe > tmp_buch2
(44 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str1
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(1 real change made)
.         replace buchstabe="b" if buchstabe=="2"
(1 real change made)
.         replace buchstabe="c" if buchstabe=="3"
(2 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(0 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(0 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(0 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(0 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(0 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(0 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(0 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000b.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(20 observations deleted)

. 
. 
. *last remaining case (case6): first and second mentioned address contain letter and both have di
> fferent numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(76 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(62 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(14 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(100 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(15 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(24 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(3 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(58 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(4,550 observations created)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n

.         replace buchstabe = buchstabe-1
(4,725 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(21 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(310 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(162 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(169 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(168 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(166 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(164 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(163 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(162 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(162 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(162 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(162 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(162 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(162 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(162 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(162 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(162 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(162 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(162 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(162 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(162 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(162 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(162 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(162 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(162 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(162 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(162 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(162 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(162 real changes made)

. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2

.   
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    49,666,875
        from master                49,666,875  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases, where the correct precinct is known for sure
.         append using `exact'    

.         
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(24 observations deleted)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(4,106 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_btw09_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_btw09_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_btw09_voll_buchsta
    > be.dta saved

. 
end of do-file
Running: 02b_import_ltw13.do

. /*
> Input: LTW2013_Straßenverzeichnis.xlsx
>         > from electoral rolls
>         > electoral roll 2013: raw addresses of all eligible voters and their assigned precincts
> 
> Output: $tmp/strassen_ltw13_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and identify street segments that are assigned to a given precinct 
>                         -> a segment is equal to a streetname + range of numbers (e.g., Mystreet
>  6-18)
>                 >> note: a maximum number is not always given (e.g., singletons and "from 6 onwa
> rds" cases) 
>                         -> we generate max numbers by hand (e.g., 6 -> 6-6 and "from 6" -> 6-320
>  (hypothetical max))
>                 
>         > from street segments extend data to include each single address (e.g., Mystreet 6, Mys
> treet 8, etc.)
>                 -> several cases to be considered:
>                 0. streets without any numbers // not the case in 2017
>                  . address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
>                 1. beginning and ending of address contain only numbers and no letters (e.g., 1-
> 15)
>                  If segments with letters, different cases:
>                         2. only beginning of the segment contains a letter (e.g., 16a-24)
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                         If segments contain letter at the beginning and the ending, different ca
> ses:
>                         4. assignment given for exactly one address (same street and same letter
> ), e.g. 16a-16a
>                         5. assignment given for exactly one street (but with different addresses
>  (letters)), e.g. 17b-17e
>                         6. first and second mentioned address contain letter and both have diffe
> rent numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. ** PULL: Raw 2013 electoral roll; import column by columns
.         tempfile col_1 col_2 col_3 col_4 

. 
.         import excel using "$rawdata/election_office/electoral_rolls/LTW2013_Straßenverzeichnis.
> xlsx",  first clear cellrange(A1:D4058) 
(4 vars, 4,057 obs)

.         drop C

.         save `col_1'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format

.          
.         import excel using "$rawdata/election_office/electoral_rolls/LTW2013_Straßenverzeichnis.
> xlsx",  first clear cellrange(E1:H4058) 
(4 vars, 4,057 obs)

.         drop G

.         save `col_2'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format

. 
.         import excel using "$rawdata/election_office/electoral_rolls/LTW2013_Straßenverzeichnis.
> xlsx",  first clear cellrange(I1:L4058) 
(4 vars, 4,057 obs)

.         drop K 

.         save `col_3'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format

. 
.         import excel using "$rawdata/election_office/electoral_rolls/LTW2013_Straßenverzeichnis.
> xlsx",  first clear cellrange(M1:P4058) 
(4 vars, 4,057 obs)

.         drop O

.         save `col_4'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format

. 
. clear 

. *append columns
.         forvalues j = 1/4 {
  2.                 append using `col_`j''
  3.         }

.         missings dropobs, force

Checking missings in Stadt Strasse Wahl:
40 observations with missing values

(40 observations deleted)

. 
. 
. /* This is what the first five rows look like. (for comparison to 2009, 2013, 2014)
>         
>         Stadt   Strasse Wahl
> bezirk          bezirk
>                 
>         Aachener Str.   
> 4       ab       1   unger.     409
> 4       ab       2   gerade     410
> */
. 
. *clean file and rename
.         rename Stadt stadtbez

.         lab var stadtbez "city district ID"

.         drop if stadtbez=="0"
(2 observations deleted)

.         rename Wahl sb

.         rename Strasse street_tmp

. 
.         
.         
.         
. * Drop empty rows and 'Stadtbezirk' label 
.         replace         street_tmp = subinstr(street_tmp, " ", "", .)
(15,491 real changes made)

.         drop if street_tmp == ""
(1,368 observations deleted)

.         drop if street_tmp == "Strasse"
(391 observations deleted)

. *       drop tmp*
. 
. * Identify whether an entry references street segment; save in separate variables
.         gen tmp = ustrregexm(street_tmp,"(ab)?[0-9]")

.         
.         // gen strasse1 := raw street name 
.         gen     street = street_tmp if tmp==0
(8,150 missing values generated)

.         
.         // fill up empty rows with street names
.         replace street = street[_n-1] if missing(street)
(8,150 real changes made)

.         
.         // gen hnr_orig_segment := street segment
.         gen     hnr_orig_segment = street_tmp if tmp==1
(6,277 missing values generated)

.         drop tmp* street_tmp

.         
. * Drop redundant entries
. *       (when multiple segments are listed; street name spans mult. rows & precinct id is empty 
> => drop these rows)
.         replace sb = subinstr(sb, " ", "", .)
(2,361 real changes made)

.         lab var sb "raw precinct id"

.         drop if missing(sb)
(2,361 observations deleted)

. 
. 
. 
. //from here onwards code is similar to 2014
. * update typing of (long) street names (checked manually)
.         replace street="Hildegard-von-Bingen-Anger" if street=="Hild.-v.-Bingen-Ang."
variable street was str24 now str26
(1 real change made)

.         replace street="Rondell Neuwittelsbach" if street=="Rond.Neuwittelsbach"
(3 real changes made)

.         replace street="Franz-Josef-Strauß-Ring" if street=="F.-J.-Strauß-Ring"
(3 real changes made)

.         replace street="Hedwig-Dransfeld-Allee" if street=="Hedwig-Dransfeld-A."
(2 real changes made)

.         replace street="Karl-Amadeus-Hartmann-Weg" if street=="Karl-A.-Hartmann-Weg"
(1 real change made)

.         replace street="Mies-van-der-Rohe-Str." if street=="Mies-van-der-Rohe-St"
(1 real change made)

.         replace street="Geschwister-Scholl-Pl." if street=="Geschw.-Scholl-Pl."
(1 real change made)

.         replace street="Walter-Klingenbeck-Weg" if street=="Walter-Klingenbeck-W"
(1 real change made)

.         replace street="Heinrich-Stieglitz-Kehre" if street=="Heinr.-Stiegl.-Kehre"
(1 real change made)

.         replace street="Jean-Paul-Richter-Str." if street=="Jean-Paul-Richter-St"
(2 real changes made)

.         replace street="Hermann-von-Sicherer-Str." if street=="Herm.v.SichererStr."
(1 real change made)

.         replace street="Christoph-Rapparini-Bogen" if street=="Christ.-Rapparini-Bg"
(1 real change made)

.         replace street="Werner-Friedmann-Bogen" if street=="Werner-Friedmann-Bg"
(1 real change made)

.         replace street="Friedenheimer Brücke" if street=="FriedenheimerBrü."
(2 real changes made)

.         replace street="Johann-Sebastian-Bach-Str." if street=="Johann-Seb-Bach-Str."
(1 real change made)

.         replace street="Maximilian-Wetzger-Str." if street=="Maximilian-Wetzger-S"
(2 real changes made)

.         replace street="Nördliche Auffahrtsallee" if street=="Ndl.-Auffahrtsallee"
(3 real changes made)

.         replace street="Nördliches Schloßrondell" if street=="Ndl.-Schloßrondell"
(1 real change made)

.         replace street="Rainer-Werner-Fassbinder-Pl." if street=="R.-W.-Fassbinder-Pl."
variable street was str26 now str28
(1 real change made)

.         replace street="Südliche Auffahrtsallee" if street=="Südl.Auffahrtsallee"
(3 real changes made)

.         replace street="Südliches Schloßrondell" if street=="Suedl.Schloßrondell"
(1 real change made)

.         replace street="Am Hartmannshofer Bächl" if street=="AmHartmannsh.Bächl"
(1 real change made)

.         replace street="Ehrenbreitsteiner Str." if street=="EhrenbreitsteinerSt"
(3 real changes made)

.         replace street="Jakob-Hagenbucher-Str." if street=="Jak.-Hagenbucher-Str"
(1 real change made)

.         replace street="Moosacher St.-Martins-Pl." if street=="MoosachSt-Martins-P"
(2 real changes made)

.         replace street="Christoph-von-Gluck-Pl." if street=="Christ.-von-Gluck-Pl"
(4 real changes made)

.         replace street="Erwin-von-Steinbach-Weg" if street=="Erw.v.-Steinbach-Weg"
(1 real change made)

.         replace street="Martin-Luther-King-Weg" if street=="Mart.Luther-King-Weg"
(1 real change made)

.         replace street="Werner-Seelenbinder-Weg" if street=="W.-Seelenbinder-Weg"
(1 real change made)

.         replace street="Alois-Wolfmüller-Str." if street=="Alois-Wolfmueller-St"
(1 real change made)

.         replace street="Christoph-Probst-Str." if street=="Christ.-Probst-Str."
(1 real change made)

.         replace street="Elisabeth-Selbert-Str." if street=="Elisabeth-Selbert-St"
(1 real change made)

.         replace street="Freimanner Bahnhofstr." if street=="FreimannerBahnhofst"
(1 real change made)

.         replace street="Heinrich-Geißler-Str." if street=="Heinr.-Geißler-Str."
(1 real change made)

.         replace street="Karl-Köglsperger-Str." if street=="Karl-Köglsperger-St"
(1 real change made)

.         replace street="Peter-Paul-Althaus-Str." if street=="Peter-Paul-Althaus-S"
(1 real change made)

.         replace street="Werner-Heisenberg-Allee" if street=="W.-Heisenberg-Allee"
(2 real changes made)

.         replace street="Adolf-Oberländer-Weg" if street=="Adolf-Oberländer-We"
(1 real change made)

.         replace street="Anschütz-Kaempfe-Str." if street=="Anschuetz-Kaempfe-S"
(1 real change made)

.         replace street="Bernhard-Lichtenberg-Weg" if street=="Bernh.-Lichtenberg-W"
(1 real change made)

.         replace street="Else-Lasker-Schüler-Str." if street=="E.-Lasker-Schüler-S"
(1 real change made)

.         replace street="Eugen-Kalkschmidt-Weg" if street=="Eug.-Kalkschmidt-Weg"
(1 real change made)

.         replace street="Friedrich-Herschel-Str." if street=="Friedr.-Herschel-Str"
(3 real changes made)

.         replace street="Gertrud-von-Le-Fort-Weg" if street=="Gertr.-v-Le-Fort-Weg"
(1 real change made)

.         replace street="Hugo-von-Hofmannsthal-Str." if street=="H.-v.-Hofmannsthal-S"
(1 real change made)

.         replace street="Johannes-Neuhäusler-Str." if street=="Joh.-Neuhäusler-Str"
(3 real changes made)

.         replace street="Marie-Luise-Kaschnitz-Str." if street=="Marie-L.-Kaschnitz-S"
(1 real change made)

.         replace street="Schnorr-von-Carolsfeld-Str." if street=="Schnorr-v-Carolsf-St"
(1 real change made)

.         replace street="Wolfgang-Borchert-Weg" if street=="Wolfg.-Borchert-Weg"
(1 real change made)

.         replace street="Zur Deutschen Einheit" if street=="ZurDeutsch.Einheit"
(2 real changes made)

.         replace street="Johann-Michael-Fischer-Pl." if street=="Joh.-Mich.-Fischer-P"
(1 real change made)

.         replace street="Anton-Geisenhofer-Str." if street=="Anton-Geisenhofer-St"
(2 real changes made)

.         replace street="Bürgermeister-Keller-Str." if street=="Bürgerm.-Keller-Str"
(1 real change made)

.         replace street="Elisabeth-Mann-Borgese-Str." if street=="Elis.-Mann-Borgese-S"
(4 real changes made)

.         replace street="Elisabeth-zu-Guttenberg-Str." if street=="Elis.-z-Guttenberg-S"
(1 real change made)

.         replace street="Friedrich-Creuzer-Str." if street=="Friedr.-Creuzer-Str"
(3 real changes made)

.         replace street="Georg-Kerschensteiner-Str." if street=="G.-kerschensteiner-s"
(4 real changes made)

.         replace street="Herzogstandstr. (Gronsdorf)" if street=="Herzogstandstr.-Grdf"
(1 real change made)

.         replace street="Maria-Montessori-Str." if street=="M.-Montessori-Str."
(2 real changes made)

.         replace street="Albert-Schweitzer-Str." if street=="Albert-Schweitzer-St"
(4 real changes made)

.         replace street="Arnold-Sommerfeld-Str." if street=="Arnold-Sommerfeld-St"
(3 real changes made)

.         replace street="Charles-de-Gaulle-Str." if street=="Charles-de-Gaulle-St"
(3 real changes made)

.         replace street="Dr.-Walther-von-Miller-Str." if street=="Dr-Walth.-v-Miller-S"
(1 real change made)

.         replace street="Friedrich-Engels-Bogen" if street=="Friedr.-Engels-Bogen"
(1 real change made)

.         replace street="Gerhart-Hauptmann-Ring" if street=="Gerh.-Hauptmann-Ring"
(5 real changes made)

.         replace street="Gertrud-Kückelmann-Weg" if street=="Gertr.-Kückelmann-W"
(1 real change made)

.         replace street="Hans-Pössenbacher-Weg" if street=="Hans-Pössenbacher-W"
(1 real change made)

.         replace street="Joseph-Maria-Lutz-Anger" if street=="Jos-Maria-Lutz-Anger"
(2 real changes made)

.         replace street="Marieluise-Fleißer-Bogen" if street=="Mariel.-Fleißer-Bog"
(1 real change made)

.         replace street="Maximilian-Kolbe-Allee" if street=="Maximil.-Kolbe-Allee"
(2 real changes made)

.         replace street="Peter-Lühr-Str." if street=="Peter-Luehr-Str."
(1 real change made)

.         replace street="Stephanskirchener Str." if street=="StephanskirchenerSt"
(1 real change made)

.         replace street="Heinrich-Kröller-Str." if street=="Heinr.-Kröller-Str."
(1 real change made)

.         replace street="Alpspitzstr. (Pullach)" if street=="Alpspitzstr.-Pullach"
(1 real change made)

.         replace street="Höllriegelskreuther Str." if street=="Hoellriegelskr.Str."
(1 real change made)

.         replace street="Vinzenz-Schüpfer-Str." if street=="Vinzenz-Schüpfer-St"
(2 real changes made)

.         replace street="Holzapfelkreuther Str." if street=="HolzapfelkreutherSt"
(2 real changes made)

.         replace street="Ludwig-Wörl-Weg" if street=="Ludwig-Woerl-Weg"
(1 real change made)

.         replace street="Annelies-Kupper-Allee" if street=="Annelies-Kupper-Alle"
(1 real change made)

.         replace street="Philippine-Schick-Allee" if street=="Philipp.-Schick-Alle"
(1 real change made)

.         replace street="Richard-Riemerschmid-Allee" if street=="Rich-Riemerschmid-Al"
(1 real change made)

.         replace street="Am Aubinger Wasserturm" if street=="AmAubingerWassert."
(2 real changes made)

.         replace street="Centa-Hafenbrädl-Str." if street=="Centa-Hafenbrädl-St"
(1 real change made)

.         replace street="Friedrichshafener Str." if street=="FriedrichshafenerSt"
(1 real change made)

.         replace street="Josef-Steinbacher-Weg" if street=="Jos.-Steinbacher-Weg"
(1 real change made)

.         replace street="Margarete-Kliemann-Weg" if street=="Marg.-Kliemann-Weg"
(1 real change made)

.         replace street="Walter-Schnackenberg-Weg" if street=="Walt-Schnackenberg-W"
(1 real change made)

.         replace street="Albert-Pfretzschner-Weg" if street=="Albert-Pfretzschn.-W"
(1 real change made)

.         replace street="Ernst-von-Romberg-Str." if street=="Ernst-von-Romberg-St"
(1 real change made)

.         replace street="Georg-Reismüller-Str." if street=="Gg.-Reismüller-Str."
(1 real change made)

.         replace street="Nikolaus-Rüdinger-Str." if street=="Nikol.-Rüdinger-Str"
(1 real change made)

.         replace street="Peter-Stegmüller-Weg" if street=="Peter-Stegmüller-Wg"
(1 real change made)

.         replace street="Auf den Schrederwiesen" if street=="Aufd.Schrederwiesen"
(5 real changes made)

.         replace street="Berthold-Litzmann-Str." if street=="Berthold-Litzmann-St"
(1 real change made)

.         replace street="Ignatius-Blenninger-Str." if street=="Ignat.-Blenninger-St"
(1 real change made)

.         replace street="Ludwig-Gramminger-Str." if street=="Ludw.-Gramminger-Str"
(1 real change made)

.         replace street="Paula-Breitenbach-Weg" if street=="Paula-Breitenbach-Wg"
(1 real change made)

.         replace street="Steinröschenstr." if street=="Steinroeschenstr."
(1 real change made)

.         replace street="Wilhelmine-Reichard-Str." if street=="Wilhelm.-Reichard-S."
(2 real changes made)

.         replace street="Johannes-Scharrer-Str." if street=="Johannes-Scharrer-St"
(1 real change made)

.         replace street="Friedrich-Brugger-Weg" if street=="Friedr.-Brugger-Weg"
(1 real change made)

.         replace street="Herzog-Albrecht-Anlage" if street=="Herzog-Albrecht-Anl."
(1 real change made)

.         replace street="Johann-Karg-Straße (Haar)" if street=="Joh.-Karg-Str.(Haar)"
(1 real change made)

.         replace street="Melitta-Bentz-Straße" if street=="Melitta-Benz-Str."
(1 real change made)

.         replace street="Roßsteinstraße" if street=="Rosssteinstr."
(3 real changes made)

.         replace street="Wolfratshauser Straße (Pul)" if street=="Wolfratsh.Str.(Pul)"
(1 real change made)

.         replace street="Jürgen-von-Hollander-Platz" if street=="J.-v.-Hollander-Pl."
(1 real change made)

.         replace street="Karl-Heinrich-Ulrichs-Platz" if street=="Karl-H.-Ulrichs-Pl."
(1 real change made)

.         replace street="Ludwig-Hilberseimer-Straße" if street=="Ludw--Hilberseimer-S"
(1 real change made)

.         replace street="Magdalena-Bräu-Weg" if street=="Magdalena-Braeu-Weg"
(1 real change made)

.         replace street="Margarete-Schütte-Lihotzky-Straße" if street=="Mar.-Schuette-Lih.-S"
variable street was str28 now str35
(1 real change made)

.         replace street="Marianne-von-Werefkin-Weg" if street=="Mar.-v.-Werefkin-W."
(1 real change made)

.         replace street="Maria-Goeppert-Mayer-Straße" if street=="M.-Goeppert-Mayer-St"
(1 real change made)

.         replace street="Paul-Heyse-Unterführung" if street=="Paul-Heyse-Unterfü."
(1 real change made)

.         replace street="Pfarrer-Rosenberger-Straße" if street=="Pfarr.-Rosenberger-S"
(1 real change made)

.         replace street="Platz der Opfer des Nationalsozialismus" if street=="Pl-d-Opferd-Nat.Soz
> "
variable street was str35 now str39
(1 real change made)

.         replace street="Resi-Huber-Platz" if street=="RESI-HUBER-PL."
(1 real change made)

.         replace street="Rudi-Hierl-Platz" if street=="RUDI-HIERL-PL."
(1 real change made)

.         replace street="Schneiderhofstraße (Gronsdorf)" if street=="Schneiderhofstr.(GR)"
(1 real change made)

.         replace street="Schwester-Adelmunda-Weg" if street=="Schwest.-Adelmunda-W"
(1 real change made)

.         replace street="Siegfried-Mollier-Straße" if street=="Siegfr.-Mollier-Str."
(1 real change made)

.         replace street="Thomas-Theodor-Heine-Weg" if street=="Thomas-Th.-Heine-Weg"
(1 real change made)

.         replace street="Wilhelm-Dörpfeld-Weg" if street=="Wilh.-Dörpfeld-Weg"
(1 real change made)

.         replace street="Wilhelm-Hausenstein-W." if street=="Wilh.-Hausenstein-W."
(1 real change made)

.         replace street="Wolfgang-Früchtl-Straße" if street=="Wolfg.-Früchtl-Str."
(1 real change made)

.         replace street="Gottfried-Koelwel-Weg" if street=="Gottfr.-Koelwel-Weg"
(1 real change made)

.         replace street="Alois-Johann-Lippl-Weg" if street=="Alois-Joh.-Lippl-Weg"
(1 real change made)

.         replace street="Sämannstraße (Gräfelfing)" if street=="Saemannstr.(Graef.)"
(1 real change made)

.         replace street="Landaubogen" if street=="Leonhard-Moll-Bogen" // re-name by the city for
>  historical reseason between 2014 and 2017
(1 real change made)

.         replace street="Ilse-Weber-Str." if street=="Paul-Lagarde-Str." // re-name by the city f
> or historical reseason between 2014 and 2017
(2 real changes made)

.         replace street="Brunnthaler Weg" if street=="Friedrich-Berber-Weg" // re-name by the cit
> y between 2014 and 2017
(1 real change made)

. 
. 
. *Change street names for geocoding
.         replace street = subinstr(street, "Kard.", "Kardinal", .)     
(2 real changes made)

.         replace street = subinstr(street, "d.", "der", .)
(2 real changes made)

.         replace street = subinstr(street, "Alb.", "Albert", .)     
(10 real changes made)

.         replace street = subinstr(street, "b.", "burger", .)     
(2 real changes made)

.         replace street = subinstr(street, "-Bog", "Bogen", .)     
(59 real changes made)

.         replace street = subinstr(street, "B.", "Bogen", .)     
(1 real change made)

.         replace street = subinstr(street, "Br.", "Brücke", .)     
(2 real changes made)

.         replace street = subinstr(street, "Bog.", "Bogen", .)     
(0 real changes made)

.         replace street = subinstr(street, "Bogenen", "Bogen", .)     
(53 real changes made)

.         replace street = subinstr(street, "Wink.", "Winkel", .)     
(1 real change made)

.         replace street = subinstr(street, "A.", "An", .)     
(1 real change made)

.         replace street = subinstr(street, "-S.", "-Str.", .)     
(5 real changes made)

.         replace street = subinstr(street, "-Rg.", "Ring", .)     
(12 real changes made)

.         replace street = subinstr(street, "-Rg", "Ring", .)     
(11 real changes made)

.         replace street = subinstr(street, "v.", "von", .)     
(2 real changes made)

.         replace street = subinstr(street, "-v-", "von", .)     
(14 real changes made)

.         replace street = subinstr(street, "Wg", "Weg", .)    if  substr(street, strlen(street)-1
> , 2) =="Wg"
(1 real change made)

.         replace street = subinstr(street, "W.", "Weg", .)    if  substr(street, strlen(street)-1
> , 2) =="W."
(1 real change made)

.         replace street = subinstr(street, "W", "Weg", .)    if  substr(street, strlen(street), 1
> ) =="W"
(1 real change made)

.         replace street = subinstr(street, "wg", "weg", .)    if  substr(street, strlen(street)-1
> , 2) =="wg"
(0 real changes made)

.         replace street = subinstr(street, "P", "Platz", .)    if  substr(street, strlen(street),
>  1) =="P"
(1 real change made)

.         replace street = subinstr(street, "St", "Straße", .)    if  substr(street, strlen(street
> )-1, 2) =="St"
(1 real change made)

. 
.         replace street="An der Streicherbreiten" if street=="A.d.Streicherbreiten"
(0 real changes made)

.         replace street="An der Hauptfeuerwache" if street=="And.Hauptfeuerwache"
(0 real changes made)

. 
. *Further change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(78 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(99 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(91 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(322 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(175 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,644 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(2,937 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,652 real changes made)

.         replace street = subinstr(street,"Straße","strasse",.)
(2,950 real changes made)

. 
.         replace street = street + "asse" if lower(substr(street, strlen(street)-2, 3)) =="str"
(117 real changes made)

.         replace street = street + "atz" if lower(substr(street, strlen(street)-1, 2)) =="pl"
(4 real changes made)

. 
.         replace street="Allensteiner strasse" if street=="Alleensteiner Strasse"
(0 real changes made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(7 real changes made)

. 
. 
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(7 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(42 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(12,060 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,886 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(318 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(323 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(430 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(528 real changes made)

. 
. 
. * different from later years: segments not only defined by "-", but also by "from" ("ab"), "even
> " ("gerade"), "odd" ("unger."), "consecutive" ("fortl.")
.         gen even = strpos(hnr_orig_segment, "gerade")

.         gen odd = strpos(hnr_orig_segment, "unger.")

.         gen ab = strpos(hnr_orig_segment, "ab")

.         gen fort = strpos(hnr_orig_segment, "fortl.")

.         gen minus = strpos(hnr_orig_segment, "-")

. 
.         assert ab==1 | ab==0

.         assert even==0 & odd==0 if fort>0

.         assert even==0 & fort==0 if odd>0

.         assert odd==0 & fort==0 if even>0

.         assert fort==even==odd==0 if ab==0& minus==0

. 
. 
. ** Extract address numbers from entries, e.g.,  '2-4gerade', 'ab26fortl.' etc.
. *       gen hnr_min / hnr_max := start number in given street 
. *       gen buchstaben_min /buchstaben_max := (optional) letter attachted to street number, e.g.
> , 44A 
. *       when whole street is assigned to precinct, hnr_orig_segment is empty
. 
. * get starting number
.         *from case
.         gen hnr_orig_segment1 = substr(hnr_orig_segment, ab+2, .) if ab==1
(9,111 missing values generated)

.         * "-" (minus) case"
.         replace hnr_orig_segment1 = substr(hnr_orig_segment, 1, minus-1) if ab==0
(4,487 real changes made)

.         *"raw" case: only one number given
.         *that is different to later years. it is possible that a singleton address is stated (6 
> instead of 6-6)
.         replace hnr_orig_segment1 = hnr_orig_segment if ab==0 & minus==0
(708 real changes made)

. *assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment1)

. 
. * get ending number
.         gen hnr_orig_segment2 = substr(hnr_orig_segment, minus+1, .) if ab==0
(6,871 missing values generated)

. *assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment2) | ab==1

.         drop if hnr_orig_segment2 == "0" // drop if 0 is the number (does not exist)
(25 observations deleted)

. 
.         *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

. 
. * change that not for all addresses a maximum number is given
. *singleton addresses
.         assert hnr_orig_segment==hnr_orig_segment1 if ab==0 & minus==0

.         replace hnr_orig_segment2 = hnr_orig_segment if ab==0 & minus==0
(0 real changes made)

. *and that not necessarily no maximum is given
.         assert  missing(hnr_orig_segment2) if missing(hnr_orig_segment)

.         replace hnr_orig_segment2 = "320" if missing(hnr_orig_segment2) & even>0
(1,099 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & odd>0
(1,072 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & fort>0
(784 real changes made)

. 
. * take only numeric part from the starting and ending hnr
. *first drop known strings
.         foreach c in "gerade" "unger." "fortl." {
  2.                 replace hnr_orig_segment1 = subinstr(hnr_orig_segment1,"`c'","",.)
  3.                 replace hnr_orig_segment2 = subinstr(hnr_orig_segment2,"`c'","",.)
  4.         }
(1,099 real changes made)
(1,510 real changes made)
(1,072 real changes made)
(1,546 real changes made)
(784 real changes made)
(1,431 real changes made)

. *then generate numeric part
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,916 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,916 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,854 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,459 missing values generated)

.         replace buchstaben_min=lower(buchstaben_min)
(187 real changes made)

.         replace buchstaben_max=lower(buchstaben_max)
(582 real changes made)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3916 missing values generated)
hnr_max: all characters numeric; replaced as int
(3916 missing values generated)

. 
. 
. ************************************************************************
. **** 2. start generating addresses// from here very similar to the other elections
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case0: streets without numbers
.         keep if missing(hnr_orig_segment)
(8,125 observations deleted)
.         
. * keep variables
.         keep stadtbez sb merge_strasse
.         
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,253,120 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(32,682,936 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,257,036 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,257,036 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,257,036 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,257,036 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,257,036 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,257,036 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,257,036 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,257,036 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,257,036 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,257,036 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,257,036 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,257,036 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,257,036 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,257,036 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,257,036 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,257,036 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,257,036 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,257,036 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,257,036 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,257,036 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,257,036 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,257,036 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,257,036 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,257,036 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,257,036 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,257,036 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,257,036 real changes made)
.         
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,916 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
. * destring 
.         destring hnr_min hnr_max, replace
hnr_min already numeric; no replace
hnr_max already numeric; no replace

. 
. *addresses with high numbers and ab/from corrected manually
.         replace hnr_max = 337 if hnr_orig_segment=="ab333unger." & merge_strasse=="fuerstenriede
> rstrasse"
(1 real change made)

.         replace hnr_max = 425 if hnr_orig_segment=="ab365unger." & merge_strasse=="riemerstrasse
> "
(1 real change made)

.         replace hnr_max = 570 if hnr_orig_segment=="ab542gerade" & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 394 if hnr_orig_segment=="ab384fortl." & merge_strasse=="balanstrasse"
(1 real change made)

.         replace hnr_max = 386 if hnr_orig_segment=="ab340gerade" & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 391 if hnr_orig_segment=="ab345unger." & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 529 if hnr_orig_segment=="ab515unger." & merge_strasse=="landsbergerst
> rasse"
(1 real change made)

.         replace hnr_max = 443 if hnr_orig_segment=="ab400fortl." & merge_strasse=="feldmochinger
> strasse"
(1 real change made)

.         replace hnr_max = 667 if hnr_orig_segment=="ab641unger." & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 334 if hnr_orig_segment=="ab332gerade" & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         replace hnr_max = 345 if hnr_orig_segment=="ab335unger." & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         assert hnr_min<=hnr_max

. 
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(8,125 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(8,125 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(8,125 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(8,125 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(8,125 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(683 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

.         
.         
. // split segments to the corresponding numbers (what is afterwards still missing are potential l
> etters belonging to addresses)
. * generate a variable containing how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. *  generate for each number a segment contains duplicates 
.         expand tmp1
(931,425 observations created)

.         drop tmp1

. 
. * generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(822,338 real changes made)

. 
. *some segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd>0 & mod(tmp3, 2) == 0
(169,212 observations deleted)

.         drop if even>0 & mod(tmp3, 2) == 1
(171,456 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment conatins only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(22,802 observations deleted)
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(14,978,080 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(576,080 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(576,080 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(576,080 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(576,080 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(576,080 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(576,080 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(576,080 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(576,080 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(576,080 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(576,080 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(576,080 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(576,080 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(576,080 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(576,080 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(576,080 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(576,080 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(576,080 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(576,080 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(576,080 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(576,080 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(576,080 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(576,080 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(576,080 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(576,080 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(576,080 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(576,080 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(576,080 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(576,080 observations deleted)

. 
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(6,194 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(4,158 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(1,683 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1,826 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(300 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(327 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(22 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(431,808 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(448,416 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(220 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(16,454 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(16,570 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(16,593 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(16,604 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(16,605 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(16,607 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(16,607 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(16,607 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(16,607 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(16,607 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(16,607 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(16,608 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(16,608 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(16,608 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(16,608 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(16,608 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(16,608 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(16,608 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(16,608 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(16,608 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(16,608 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(16,608 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(16,608 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(16,608 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(16,608 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(16,608 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(16,608 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000008.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(16,750 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,426 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(1,270 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(750 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(173 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(48 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(36 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(42 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(73 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(13 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
variable tmp_buch was str1 now str2
(1 real change made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(20 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(157,352 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(163,404 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(13,292 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(6,052 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(6,052 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,713 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,607 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,549 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(5,531 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(5,521 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(5,514 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(5,509 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(5,507 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(5,505 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(5,505 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(5,504 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(5,504 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(5,503 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(5,503 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(5,503 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(5,503 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(5,503 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(5,503 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(5,503 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(5,503 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(5,503 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(5,503 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(5,503 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(5,503 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(5,503 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000009.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(22,660 observations deleted)

.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(126 observations deleted)
.         gen buchstabe = buchstaben_min
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000a.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(138 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(1 missing value generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(0 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1 real change made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(4 missing values generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(2 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(0 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(2 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(100 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==26)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         drop if buchstabe < tmp_buch
(2 observations deleted)
.         drop if buchstabe > tmp_buch2
(92 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str1
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(3 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(3 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(2 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(0 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(0 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(0 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(0 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(0 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(0 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(0 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000b.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(20 observations deleted)

. 
. 
. *last remaining case (case6): first and second mentioned address contain letter and both have di
> fferent numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(73 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(59 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(14 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(47 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(15 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(28 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(4 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(3,172 observations created)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n

.         replace buchstabe = buchstabe-1
(3,294 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(20 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(312 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(109 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(117 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(115 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(113 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(110 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(109 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(109 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(109 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(109 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(109 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(109 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(109 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(109 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(109 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(109 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(109 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(109 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(109 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(109 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(109 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(109 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(109 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(109 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(109 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(109 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(109 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(109 real changes made)

. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2

.   
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    50,079,860
        from master                50,079,860  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases, where the correct precinct is known for sure
.         append using `exact'    

.         
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

. 
. * Handle duplicate addresses:
.         * 1) duplicates within district accross precincts: drop BOTH b/c definitive assignment t
> o precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(24 observations deleted)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(3,998 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_ltw13_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_ltw13_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_ltw13_voll_buchsta
    > be.dta saved

. 
end of do-file
Running: 02c_import_kow14.do

. /*
> Input: KommW2014_Strassenverzeichnis.xlsx
>         > electoral roll 2014: raw addresses of all eligible voters and their assigned precinct
> 
> 
> Output: tmp/strassen_kow14_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and identify street segments that are assigned to a given precinct 
>                         -> a segment is equal to a streetname + range of numbers (e.g., Mystreet
>  6-18)
>                 >> note: a maximum number is not always given (e.g., singletons and "from 6 onwa
> rds" cases) 
>                         -> we generate max numbers by hand (e.g., 6 -> 6-6 and "from 6" -> 6-320
>  (hypothetical max))
>                 
>         > from street segments extend data to include each single address (e.g., Mystreet 6, Mys
> treet 8, etc.)
>                 -> several cases to be considered:
>                 0. streets without any numbers // not the case in 2017
>                  . address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
>                 1. beginning and ending of address contain only numbers and no letters (e.g., 1-
> 15)
>                  If segments with letters, different cases:
>                         2. only beginning of the segment contains a letter (e.g., 16a-24)
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                         If segments contain letter at the beginning and the ending, different ca
> ses:
>                         4. assignment given for exactly one address (same street and same letter
> ), e.g. 16a-16a
>                         5. assignment given for exactly one street (but with different addresses
>  (letters)), e.g. 17b-17e
>                         6. first and second mentioned address contain letter and both have diffe
> rent numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. import excel using "$rawdata/election_office/electoral_rolls/KommW2014_Strassenverzeichnis.xlsx"
> , clear cellrange(A1:G6600) // first
(7 vars, 6,600 obs)

. 
. *clean file and rename
.         rename A v1

.         rename B v2

.         rename C v3

.         rename D v4

.         rename E v5

.         rename F v6

.         rename G v7

.         drop v2 v4 v6

. 
. /* This is how the first five rows look like. (for comparison to 2009, 2013, 2014)
> 
> v1      v3      v5      v7
> S t a d t b e z i r k   01      Neuturmstr.     Burgstr.        Westenriederstr.
>         Odeonspl.       Dienerstr.      6  -  29   fortl.
> S t i m m b e z i r k   0101    ab       6   fortl.     Dreifaltigkeitspl.      
>         Orlandostr.     Falkenturmstr.  
> Wahllokal:      Pfisterstr.     2       
> */
. 
. * generate a running number (will be necessary for creating a "page")
.         gen num = _n

. 
. * define first row of each page (all pages have the same number of rows (40 + 1 empty, where the
>  next page starts))
.         gen tmp1 = mod(num,41)

.         gen tmp2 = tmp1==0

. 
. * drop empty rows
.         drop if tmp2==1
(160 observations deleted)

.         cap drop tmp2 tmp3

. *generate page variable for each observation
.         gen page = (num - tmp1)/41 + 1

.         drop num tmp1

.         
. *summarize to get the maximum (=page number)
.         sum page //max 161

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
        page |      6,440          81    46.47941          1        161

.         local max = r(max)

. *re-organize data: save each column and page separately
.         foreach v in "1" "3" "5" "7" { //columns
  2.                 forvalues p=1/`max' { //pages
  3.                         
.                         frame copy default tmp, replace
  4.                         frame tmp {
  5.                                 keep if page==`p'
  6.                                 keep v`v'
  7.                                 rename v`v' street
  8.                                 save "$tmp/strassen_14_v`v'_page`p'", replace
  9.                         }
 10.                 }
 11.         }
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page1.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page1.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page2.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page2.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page3.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page3.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page4.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page4.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page5.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page5.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page6.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page6.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page7.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page7.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page8.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page8.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page9.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page9.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page10.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page10.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page11.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page11.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page12.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page12.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page13.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page13.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page14.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page14.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page15.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page15.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page16.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page16.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page17.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page17.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page18.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page18.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page19.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page19.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page20.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page20.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page21.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page21.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page22.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page22.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page23.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page23.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page24.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page24.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page25.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page25.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page26.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page26.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page27.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page27.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page28.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page28.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page29.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page29.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page30.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page30.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page31.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page31.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page32.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page32.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page33.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page33.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page34.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page34.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page35.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page35.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page36.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page36.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page37.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page37.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page38.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page38.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page39.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page39.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page40.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page40.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page41.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page41.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page42.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page42.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page43.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page43.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page44.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page44.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page45.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page45.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page46.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page46.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page47.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page47.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page48.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page48.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page49.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page49.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page50.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page50.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page51.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page51.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page52.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page52.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page53.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page53.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page54.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page54.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page55.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page55.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page56.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page56.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page57.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page57.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page58.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page58.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page59.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page59.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page60.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page60.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page61.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page61.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page62.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page62.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page63.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page63.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page64.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page64.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page65.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page65.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page66.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page66.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page67.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page67.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page68.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page68.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page69.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page69.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page70.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page70.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page71.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page71.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page72.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page72.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page73.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page73.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page74.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page74.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page75.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page75.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page76.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page76.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page77.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page77.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page78.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page78.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page79.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page79.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page80.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page80.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page81.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page81.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page82.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page82.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page83.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page83.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page84.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page84.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page85.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page85.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page86.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page86.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page87.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page87.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page88.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page88.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page89.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page89.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page90.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page90.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page91.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page91.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page92.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page92.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page93.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page93.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page94.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page94.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page95.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page95.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page96.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page96.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page97.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page97.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page98.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page98.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page99.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page99.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page100.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page100.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page101.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page101.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page102.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page102.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page103.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page103.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page104.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page104.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page105.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page105.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page106.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page106.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page107.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page107.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page108.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page108.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page109.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page109.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page110.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page110.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page111.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page111.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page112.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page112.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page113.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page113.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page114.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page114.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page115.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page115.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page116.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page116.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page117.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page117.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page118.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page118.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page119.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page119.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page120.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page120.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page121.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page121.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page122.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page122.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page123.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page123.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page124.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page124.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page125.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page125.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page126.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page126.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page127.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page127.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page128.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page128.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page129.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page129.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page130.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page130.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page131.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page131.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page132.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page132.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page133.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page133.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page134.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page134.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page135.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page135.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page136.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page136.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page137.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page137.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page138.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page138.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page139.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page139.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page140.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page140.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page141.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page141.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page142.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page142.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page143.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page143.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page144.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page144.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page145.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page145.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page146.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page146.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page147.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page147.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page148.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page148.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page149.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page149.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page150.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page150.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page151.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page151.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page152.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page152.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page153.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page153.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page154.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page154.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page155.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page155.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page156.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page156.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page157.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page157.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page158.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page158.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page159.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page159.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page160.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page160.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page161.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v1_page161.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page1.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page1.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page2.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page2.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page3.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page3.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page4.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page4.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page5.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page5.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page6.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page6.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page7.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page7.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page8.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page8.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page9.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page9.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page10.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page10.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page11.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page11.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page12.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page12.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page13.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page13.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page14.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page14.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page15.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page15.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page16.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page16.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page17.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page17.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page18.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page18.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page19.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page19.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page20.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page20.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page21.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page21.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page22.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page22.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page23.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page23.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page24.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page24.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page25.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page25.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page26.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page26.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page27.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page27.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page28.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page28.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page29.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page29.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page30.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page30.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page31.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page31.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page32.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page32.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page33.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page33.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page34.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page34.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page35.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page35.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page36.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page36.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page37.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page37.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page38.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page38.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page39.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page39.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page40.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page40.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page41.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page41.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page42.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page42.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page43.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page43.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page44.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page44.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page45.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page45.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page46.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page46.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page47.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page47.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page48.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page48.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page49.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page49.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page50.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page50.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page51.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page51.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page52.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page52.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page53.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page53.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page54.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page54.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page55.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page55.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page56.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page56.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page57.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page57.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page58.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page58.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page59.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page59.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page60.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page60.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page61.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page61.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page62.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page62.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page63.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page63.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page64.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page64.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page65.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page65.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page66.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page66.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page67.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page67.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page68.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page68.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page69.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page69.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page70.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page70.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page71.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page71.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page72.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page72.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page73.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page73.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page74.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page74.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page75.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page75.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page76.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page76.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page77.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page77.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page78.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page78.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page79.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page79.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page80.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page80.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page81.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page81.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page82.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page82.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page83.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page83.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page84.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page84.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page85.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page85.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page86.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page86.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page87.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page87.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page88.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page88.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page89.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page89.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page90.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page90.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page91.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page91.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page92.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page92.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page93.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page93.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page94.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page94.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page95.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page95.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page96.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page96.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page97.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page97.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page98.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page98.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page99.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page99.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page100.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page100.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page101.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page101.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page102.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page102.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page103.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page103.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page104.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page104.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page105.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page105.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page106.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page106.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page107.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page107.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page108.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page108.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page109.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page109.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page110.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page110.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page111.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page111.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page112.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page112.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page113.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page113.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page114.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page114.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page115.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page115.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page116.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page116.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page117.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page117.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page118.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page118.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page119.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page119.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page120.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page120.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page121.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page121.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page122.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page122.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page123.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page123.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page124.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page124.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page125.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page125.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page126.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page126.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page127.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page127.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page128.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page128.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page129.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page129.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page130.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page130.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page131.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page131.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page132.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page132.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page133.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page133.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page134.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page134.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page135.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page135.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page136.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page136.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page137.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page137.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page138.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page138.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page139.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page139.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page140.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page140.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page141.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page141.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page142.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page142.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page143.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page143.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page144.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page144.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page145.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page145.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page146.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page146.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page147.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page147.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page148.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page148.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page149.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page149.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page150.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page150.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page151.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page151.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page152.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page152.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page153.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page153.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page154.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page154.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page155.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page155.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page156.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page156.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page157.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page157.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page158.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page158.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page159.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page159.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page160.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page160.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page161.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v3_page161.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page1.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page1.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page2.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page2.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page3.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page3.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page4.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page4.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page5.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page5.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page6.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page6.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page7.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page7.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page8.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page8.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page9.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page9.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page10.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page10.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page11.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page11.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page12.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page12.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page13.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page13.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page14.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page14.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page15.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page15.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page16.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page16.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page17.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page17.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page18.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page18.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page19.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page19.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page20.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page20.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page21.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page21.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page22.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page22.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page23.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page23.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page24.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page24.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page25.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page25.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page26.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page26.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page27.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page27.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page28.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page28.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page29.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page29.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page30.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page30.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page31.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page31.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page32.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page32.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page33.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page33.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page34.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page34.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page35.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page35.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page36.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page36.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page37.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page37.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page38.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page38.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page39.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page39.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page40.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page40.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page41.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page41.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page42.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page42.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page43.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page43.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page44.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page44.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page45.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page45.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page46.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page46.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page47.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page47.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page48.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page48.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page49.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page49.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page50.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page50.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page51.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page51.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page52.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page52.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page53.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page53.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page54.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page54.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page55.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page55.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page56.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page56.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page57.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page57.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page58.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page58.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page59.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page59.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page60.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page60.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page61.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page61.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page62.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page62.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page63.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page63.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page64.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page64.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page65.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page65.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page66.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page66.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page67.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page67.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page68.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page68.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page69.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page69.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page70.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page70.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page71.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page71.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page72.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page72.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page73.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page73.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page74.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page74.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page75.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page75.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page76.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page76.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page77.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page77.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page78.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page78.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page79.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page79.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page80.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page80.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page81.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page81.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page82.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page82.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page83.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page83.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page84.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page84.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page85.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page85.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page86.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page86.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page87.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page87.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page88.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page88.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page89.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page89.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page90.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page90.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page91.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page91.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page92.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page92.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page93.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page93.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page94.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page94.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page95.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page95.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page96.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page96.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page97.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page97.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page98.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page98.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page99.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page99.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page100.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page100.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page101.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page101.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page102.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page102.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page103.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page103.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page104.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page104.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page105.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page105.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page106.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page106.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page107.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page107.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page108.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page108.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page109.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page109.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page110.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page110.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page111.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page111.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page112.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page112.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page113.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page113.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page114.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page114.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page115.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page115.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page116.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page116.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page117.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page117.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page118.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page118.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page119.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page119.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page120.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page120.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page121.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page121.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page122.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page122.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page123.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page123.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page124.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page124.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page125.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page125.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page126.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page126.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page127.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page127.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page128.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page128.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page129.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page129.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page130.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page130.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page131.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page131.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page132.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page132.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page133.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page133.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page134.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page134.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page135.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page135.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page136.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page136.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page137.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page137.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page138.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page138.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page139.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page139.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page140.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page140.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page141.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page141.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page142.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page142.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page143.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page143.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page144.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page144.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page145.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page145.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page146.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page146.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page147.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page147.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page148.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page148.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page149.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page149.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page150.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page150.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page151.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page151.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page152.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page152.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page153.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page153.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page154.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page154.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page155.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page155.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page156.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page156.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page157.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page157.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page158.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page158.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page159.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page159.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page160.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page160.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page161.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v5_page161.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page1.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page1.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page2.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page2.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page3.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page3.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page4.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page4.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page5.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page5.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page6.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page6.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page7.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page7.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page8.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page8.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page9.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page9.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page10.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page10.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page11.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page11.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page12.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page12.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page13.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page13.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page14.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page14.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page15.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page15.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page16.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page16.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page17.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page17.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page18.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page18.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page19.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page19.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page20.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page20.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page21.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page21.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page22.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page22.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page23.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page23.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page24.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page24.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page25.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page25.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page26.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page26.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page27.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page27.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page28.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page28.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page29.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page29.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page30.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page30.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page31.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page31.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page32.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page32.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page33.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page33.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page34.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page34.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page35.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page35.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page36.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page36.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page37.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page37.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page38.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page38.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page39.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page39.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page40.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page40.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page41.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page41.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page42.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page42.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page43.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page43.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page44.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page44.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page45.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page45.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page46.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page46.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page47.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page47.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page48.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page48.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page49.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page49.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page50.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page50.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page51.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page51.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page52.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page52.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page53.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page53.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page54.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page54.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page55.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page55.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page56.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page56.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page57.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page57.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page58.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page58.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page59.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page59.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page60.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page60.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page61.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page61.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page62.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page62.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page63.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page63.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page64.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page64.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page65.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page65.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page66.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page66.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page67.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page67.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page68.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page68.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page69.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page69.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page70.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page70.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page71.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page71.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page72.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page72.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page73.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page73.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page74.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page74.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page75.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page75.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page76.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page76.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page77.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page77.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page78.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page78.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page79.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page79.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page80.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page80.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page81.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page81.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page82.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page82.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page83.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page83.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page84.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page84.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page85.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page85.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page86.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page86.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page87.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page87.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page88.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page88.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page89.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page89.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page90.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page90.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page91.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page91.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page92.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page92.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page93.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page93.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page94.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page94.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page95.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page95.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page96.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page96.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page97.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page97.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page98.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page98.dta
    saved
(6,400 observations deleted)
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page99.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page99.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page100.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page100.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page101.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page101.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page102.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page102.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page103.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page103.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page104.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page104.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page105.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page105.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page106.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page106.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page107.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page107.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page108.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page108.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page109.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page109.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page110.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page110.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page111.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page111.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page112.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page112.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page113.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page113.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page114.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page114.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page115.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page115.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page116.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page116.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page117.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page117.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page118.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page118.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page119.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page119.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page120.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page120.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page121.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page121.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page122.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page122.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page123.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page123.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page124.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page124.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page125.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page125.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page126.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page126.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page127.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page127.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page128.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page128.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page129.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page129.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page130.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page130.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page131.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page131.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page132.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page132.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page133.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page133.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page134.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page134.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page135.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page135.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page136.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page136.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page137.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page137.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page138.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page138.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page139.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page139.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page140.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page140.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page141.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page141.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page142.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page142.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page143.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page143.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page144.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page144.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page145.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page145.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page146.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page146.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page147.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page147.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page148.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page148.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page149.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page149.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page150.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page150.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page151.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page151.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page152.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page152.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page153.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page153.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page154.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page154.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page155.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page155.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page156.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page156.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page157.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page157.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page158.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page158.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page159.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page159.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page160.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page160.dta
    saved
(6,400 observations deleted)
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page161.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_14_v7_page161.dta
    saved

. 
. 
. 
. *combine data again: by column and page 
. use "$tmp/strassen_14_v1_page1", clear

. 
.         append using "$tmp/strassen_14_v3_page1"

.         append using "$tmp/strassen_14_v5_page1"

.         append using "$tmp/strassen_14_v7_page1"

. 
.         forvalues p=2/`max' {
  2.                 foreach v in "1" "3" "5" "7" {
  3. 
.                         append using "$tmp/strassen_14_v`v'_page`p'"
  4.                 
.                 }
  5.         }

. 
. *erase unnecessary files
.         foreach v in "1" "3" "5" "7" { //columns
  2.                 forvalues p=1/`max' { //pages
  3.                         erase "$tmp/strassen_14_v`v'_page`p'.dta"
  4.                 }
  5.         }

. 
. 
. // first: genenerate districts and precinct IDs
.         gen stadtbez = subinstr(street,"S t a d t b e z i r k","",.) if substr(street, 1, 21)=="
> S t a d t b e z i r k"
(25,735 missing values generated)

.         lab var stadtbez "city district ID"

.         replace stadtbez = subinstr(stadtbez," ","",.) 
(25 real changes made)

.         replace stadtbez = subinstr(stadtbez,"0","",.) if substr(stadtbez,1,1) =="0"
(9 real changes made)

.         gen sb = subinstr(street,"S t i m m b e z i r k","",.) if substr(street, 1, 21)=="S t i 
> m m b e z i r k"
(25,058 missing values generated)

. 
. *clean street
.         replace street = subinstr(street, " ", "", .)
(25,024 real changes made)

. 
. // second: drop polling place addresses and keep only addresses of eligible voters
. // polling places are always directly below the precinct
. *generate polling places to drop them
.         gen wahllokal_tmp = "wahllokal" if substr(street, 1, 10)=="Wahllokal:"
(25,058 missing values generated)

. *fill rows below
.         replace wahllokal_tmp = wahllokal_tmp[_n-1] if missing(street)==0 & wahllokal_tmp != "wa
> hllokal"
(1,452 real changes made)

. *drop rows with polling place
.         drop if wahllokal_tmp=="wahllokal"
(2,154 observations deleted)

.         drop wahllokal_tmp

. 
. *select rows in the street variable that will be dropped because no street is named but only the
>  district or precinct
.         replace street = "" if !missing(stadtbez) | !missing(sb)
(727 real changes made)

. 
. 
. *assign districts and precints to streets
.         replace stadtbez = stadtbez[_n-1] if missing(stadtbez)
(23,581 real changes made)

.         replace sb = sb[_n-1] if missing(sb)
(22,902 real changes made)

.         lab var sb "raw precinct id"

. 
. *drop observations where no street is named (coming from district or precinct rows)
.         drop if missing(street)
(5,641 observations deleted)

.         
. *gen voter address (street) number: either start with a number or start with "ab" (=from)
.         gen hnr_orig_segment = street   if inlist(substr(street, 1, 1), "0", "1", "2", "3", "4")
>  | inlist(substr(street, 1, 1), "5", "6", "7", "8", "9") 
(12,715 missing values generated)

.         replace hnr_orig_segment = street if substr(street, 1, 2) == "ab"
(2,965 real changes made)

. 
.         
.         
.         
. * clean voter street: if there is a number of the address, it is in the next row
. * drop the information in the rows where the numbers/segments are given
.         replace street="." if missing(hnr_orig_segment)==0
(8,215 real changes made)

. *generate a preliminary street below the street (where the number/segment stands)
.         gen street_tmp = street[_n-1] if street=="."
(9,750 missing values generated)

. * add it again if there is more than one segment to the same street
.         replace street_tmp = street_tmp[_n-1] if street_tmp=="."
(1,995 real changes made)

. *replace the original street if only segments are given and the street is now in the temporary "
> strasse1"
.         replace street="." if street[_n+1]=="."
(6,220 real changes made)

. *replace the street variable with the temporary variable
.         replace street = street_tmp if street == "."
(14,435 real changes made)

. *drop temporary variable
.         drop street_tmp

. *drop the row where the street above the segment information was listed before
.         drop if missing(street) // if the address goes over more than one row, the duplicate is 
> dropped here
(6,220 observations deleted)

. 
. 
. * correcting small typos
.         replace street = subinstr(street,"?","",.)
(12 real changes made)

. 
. * update typing of (long) street names (checked manually)
.         replace street="Hildegard-von-Bingen-Anger" if street=="Hild.-v.-Bingen-Ang."
(1 real change made)

.         replace street="Rondell Neuwittelsbach" if street=="Rond.Neuwittelsbach"
(3 real changes made)

.         replace street="Franz-Josef-Strauß-Ring" if street=="F.-J.-Strauß-Ring"
(3 real changes made)

.         replace street="Hedwig-Dransfeld-Allee" if street=="Hedwig-Dransfeld-A."
(2 real changes made)

.         replace street="Karl-Amadeus-Hartmann-Weg" if street=="Karl-A.-Hartmann-Weg"
(1 real change made)

.         replace street="Geschwister-Scholl-Pl." if street=="Geschw.-Scholl-Pl."
(1 real change made)

.         replace street="Walter-Klingenbeck-Weg" if street=="Walter-Klingenbeck-W"
(1 real change made)

.         replace street="Heinrich-Stieglitz-Kehre" if street=="Heinr.-Stiegl.-Kehre"
(1 real change made)

.         replace street="Jean-Paul-Richter-Str." if street=="Jean-Paul-Richter-St"
(3 real changes made)

.         replace street="Hermann-von-Sicherer-Str." if street=="Herm.v.SichererStr."
(1 real change made)

.         replace street="Christoph-Rapparini-Bogen" if street=="Christ.-Rapparini-Bg"
(1 real change made)

.         replace street="Werner-Friedmann-Bogen" if street=="Werner-Friedmann-Bg"
(1 real change made)

.         replace street="Friedenheimer Brücke" if street=="FriedenheimerBrü."
(1 real change made)

.         replace street="Johann-Sebastian-Bach-Str." if street=="Johann-Seb-Bach-Str."
(1 real change made)

.         replace street="Maximilian-Wetzger-Str." if street=="Maximilian-Wetzger-S"
(2 real changes made)

.         replace street="Nördliche Auffahrtsallee" if street=="Ndl.-Auffahrtsallee"
(3 real changes made)

.         replace street="Nördliches Schloßrondell" if street=="Ndl.-Schloßrondell"
(1 real change made)

.         replace street="Rainer-Werner-Fassbinder-Pl." if street=="R.-W.-Fassbinder-Pl."
(1 real change made)

.         replace street="Südliches Schloßrondell" if street=="Suedl.Schloßrondell"
(1 real change made)

.         replace street="Ehrenbreitsteiner Str." if street=="EhrenbreitsteinerSt"
(3 real changes made)

.         replace street="Jakob-Hagenbucher-Str." if street=="Jak.-Hagenbucher-Str"
(1 real change made)

.         replace street="Moosacher St.-Martins-Pl." if street=="MoosachSt-Martins-P"
(2 real changes made)

.         replace street="Christoph-von-Gluck-Pl." if street=="Christ.-von-Gluck-Pl"
(4 real changes made)

.         replace street="Erwin-von-Steinbach-Weg" if street=="Erw.v.-Steinbach-Weg"
(1 real change made)

.         replace street="Martin-Luther-King-Weg" if street=="Mart.Luther-King-Weg"
(1 real change made)

.         replace street="Werner-Seelenbinder-Weg" if street=="W.-Seelenbinder-Weg"
(1 real change made)

.         replace street="Alois-Wolfmüller-Str." if street=="Alois-Wolfmueller-St"
(1 real change made)

.         replace street="Christoph-Probst-Str." if street=="Christ.-Probst-Str."
(1 real change made)

.         replace street="Elisabeth-Selbert-Str." if street=="Elisabeth-Selbert-St"
(1 real change made)

.         replace street="Freimanner Bahnhofstr." if street=="FreimannerBahnhofst"
(1 real change made)

.         replace street="Heinrich-Geißler-Str." if street=="Heinr.-Geißler-Str."
(1 real change made)

.         replace street="Karl-Köglsperger-Str." if street=="Karl-Köglsperger-St"
(1 real change made)

.         replace street="Peter-Paul-Althaus-Str." if street=="Peter-Paul-Althaus-S"
(1 real change made)

.         replace street="Werner-Heisenberg-Allee" if street=="W.-Heisenberg-Allee"
(2 real changes made)

.         replace street="Adolf-Oberländer-Weg" if street=="Adolf-Oberländer-We"
(1 real change made)

.         replace street="Anschütz-Kaempfe-Str." if street=="Anschuetz-Kaempfe-S"
(1 real change made)

.         replace street="Bernhard-Lichtenberg-Weg" if street=="Bernh.-Lichtenberg-W"
(1 real change made)

.         replace street="Else-Lasker-Schüler-Str." if street=="E.-Lasker-Schüler-S"
(1 real change made)

.         replace street="Eugen-Kalkschmidt-Weg" if street=="Eug.-Kalkschmidt-Weg"
(1 real change made)

.         replace street="Friedrich-Herschel-Str." if street=="Friedr.-Herschel-Str"
(3 real changes made)

.         replace street="Gertrud-von-Le-Fort-Weg" if street=="Gertr.-v-Le-Fort-Weg"
(1 real change made)

.         replace street="Hugo-von-Hofmannsthal-Str." if street=="H.-v.-Hofmannsthal-S"
(1 real change made)

.         replace street="Johannes-Neuhäusler-Str." if street=="Joh.-Neuhäusler-Str"
(3 real changes made)

.         replace street="Marie-Luise-Kaschnitz-Str." if street=="Marie-L.-Kaschnitz-S"
(1 real change made)

.         replace street="Wolfgang-Borchert-Weg" if street=="Wolfg.-Borchert-Weg"
(1 real change made)

.         replace street="Johann-Michael-Fischer-Pl." if street=="Joh.-Mich.-Fischer-P"
(1 real change made)

.         replace street="Bürgermeister-Keller-Str." if street=="Bürgerm.-Keller-Str"
(1 real change made)

.         replace street="Elisabeth-Mann-Borgese-Str." if street=="Elis.-Mann-Borgese-S"
(4 real changes made)

.         replace street="Elisabeth-zu-Guttenberg-Str." if street=="Elis.-z-Guttenberg-S"
(1 real change made)

.         replace street="Friedrich-Creuzer-Str." if street=="Friedr.-Creuzer-Str"
(3 real changes made)

.         replace street="Herzogstandstr. (Gronsdorf)" if street=="Herzogstandstr.-Grdf"
(1 real change made)

.         replace street="Maria-Montessori-Str." if street=="M.-Montessori-Str."
(2 real changes made)

.         replace street="Albert-Schweitzer-Str." if street=="Albert-Schweitzer-St"
(4 real changes made)

.         replace street="Arnold-Sommerfeld-Str." if street=="Arnold-Sommerfeld-St"
(3 real changes made)

.         replace street="Charles-de-Gaulle-Str." if street=="Charles-de-Gaulle-St"
(3 real changes made)

.         replace street="Dr.-Walther-von-Miller-Str." if street=="Dr-Walth.-v-Miller-S"
(1 real change made)

.         replace street="Friedrich-Engels-Bogen" if street=="Friedr.-Engels-Bogen"
(2 real changes made)

.         replace street="Gerhart-Hauptmann-Ring" if street=="Gerh.-Hauptmann-Ring"
(5 real changes made)

.         replace street="Gertrud-Kückelmann-Weg" if street=="Gertr.-Kückelmann-W"
(1 real change made)

.         replace street="Hans-Pössenbacher-Weg" if street=="Hans-Pössenbacher-W"
(1 real change made)

.         replace street="Joseph-Maria-Lutz-Anger" if street=="Jos-Maria-Lutz-Anger"
(2 real changes made)

.         replace street="Marieluise-Fleißer-Bogen" if street=="Mariel.-Fleißer-Bog"
(1 real change made)

.         replace street="Maximilian-Kolbe-Allee" if street=="Maximil.-Kolbe-Allee"
(2 real changes made)

.         replace street="Peter-Lühr-Str." if street=="Peter-Luehr-Str."
(1 real change made)

.         replace street="Stephanskirchener Str." if street=="StephanskirchenerSt"
(1 real change made)

.         replace street="Heinrich-Kröller-Str." if street=="Heinr.-Kröller-Str."
(1 real change made)

.         replace street="Alpspitzstr. (Pullach)" if street=="Alpspitzstr.-Pullach"
(1 real change made)

.         replace street="Höllriegelskreuther Str." if street=="Hoellriegelskr.Str."
(1 real change made)

.         replace street="Vinzenz-Schüpfer-Str." if street=="Vinzenz-Schüpfer-St"
(2 real changes made)

.         replace street="Holzapfelkreuther Str." if street=="HolzapfelkreutherSt"
(2 real changes made)

.         replace street="Ludwig-Wörl-Weg" if street=="Ludwig-Woerl-Weg"
(1 real change made)

.         replace street="Annelies-Kupper-Allee" if street=="Annelies-Kupper-Alle"
(1 real change made)

.         replace street="Philippine-Schick-Allee" if street=="Philipp.-Schick-Alle"
(1 real change made)

.         replace street="Richard-Riemerschmid-Allee" if street=="Rich-Riemerschmid-Al"
(1 real change made)

.         replace street="Am Aubinger Wasserturm" if street=="AmAubingerWassert."
(2 real changes made)

.         replace street="Friedrichshafener Str." if street=="FriedrichshafenerSt"
(1 real change made)

.         replace street="Josef-Steinbacher-Weg" if street=="Jos.-Steinbacher-Weg"
(1 real change made)

.         replace street="Margarete-Kliemann-Weg" if street=="Marg.-Kliemann-Weg"
(1 real change made)

.         replace street="Walter-Schnackenberg-Weg" if street=="Walt-Schnackenberg-W"
(1 real change made)

.         replace street="Albert-Pfretzschner-Weg" if street=="Albert-Pfretzschn.-W"
(1 real change made)

.         replace street="Ernst-von-Romberg-Str." if street=="Ernst-von-Romberg-St"
(1 real change made)

.         replace street="Georg-Reismüller-Str." if street=="Gg.-Reismüller-Str."
(1 real change made)

.         replace street="Nikolaus-Rüdinger-Str." if street=="Nikol.-Rüdinger-Str"
(1 real change made)

.         replace street="Peter-Stegmüller-Weg" if street=="Peter-Stegmüller-Wg"
(1 real change made)

.         replace street="Auf den Schrederwiesen" if street=="Aufd.Schrederwiesen"
(5 real changes made)

.         replace street="Berthold-Litzmann-Str." if street=="Berthold-Litzmann-St"
(1 real change made)

.         replace street="Ignatius-Blenninger-Str." if street=="Ignat.-Blenninger-St"
(1 real change made)

.         replace street="Ludwig-Gramminger-Str." if street=="Ludw.-Gramminger-Str"
(1 real change made)

.         replace street="Paula-Breitenbach-Weg" if street=="Paula-Breitenbach-Wg"
(1 real change made)

.         replace street="Steinröschenstr." if street=="Steinroeschenstr."
(1 real change made)

.         replace street="Wilhelmine-Reichard-Str." if street=="Wilhelm.-Reichard-S."
(2 real changes made)

.         replace street="Johannes-Scharrer-Str." if street=="Johannes-Scharrer-St"
(1 real change made)

.         replace street="Johann-Karg-Straße (Haar)" if street=="Joh.-Karg-Str.(Haar)"
(1 real change made)

.         replace street="Roßsteinstraße" if street=="Rosssteinstr."
(3 real changes made)

.         replace street="Wolfratshauser Straße (Pul)" if street=="Wolfratsh.Str.(Pul)"
(1 real change made)

.         replace street="Magdalena-Bräu-Weg" if street=="Magdalena-Braeu-Weg"
(1 real change made)

.         replace street="Margarete-Schütte-Lihotzky-Straße" if street=="Mar.-Schuette-Lih.-S"
variable street was str33 now str35
(1 real change made)

.         replace street="Schneiderhofstraße (Gronsdorf)" if street=="Schneiderhofstr.(GR)"
(1 real change made)

.         replace street="Gottfried-Koelwel-Weg" if street=="Gottfr.-Koelwel-Weg"
(1 real change made)

.         replace street="Georg-Kerschensteiner-Straße" if street=="Georg-Kerschenst.-S."
(4 real changes made)

.         replace street="Schnorr-von-Carolsfeld-Straße" if street=="Sch.v-Carolsfeld-Str"
(1 real change made)

.         replace street="Zur Deutschen Einheit" if street=="Z.DeutschenEinheit"
(2 real changes made)

.         replace street="Südliche Auffahrtsallee" if street=="Suedl.Auffahrtsallee"
(3 real changes made)

.         replace street="Sämannstraße (Gräfelfing)" if street=="Saemannstr.(Graef.)"
(1 real change made)

.         replace street="Am Hartmannshofer Bächl" if street=="AmHartmannsh.Bächl"
(1 real change made)

.         replace street="Landaubogen" if street=="Leonhard-Moll-Bogen" // re-name by the city for
>  historical reseason between 2014 and 2017
(1 real change made)

.         replace street="Ilse-Weber-Str." if street=="Paul-Lagarde-Str." // re-name by the city f
> or historical reseason between 2014 and 2017
(2 real changes made)

.         replace street="Brunnthaler Weg" if street=="Friedrich-Berber-Weg" // re-name by the cit
> y between 2014 and 2017
(1 real change made)

. 
. 
. *Change street names for geocoding
.         replace street = subinstr(street, "Kard.", "Kardinal", .)     
(2 real changes made)

.         replace street = subinstr(street, "d.", "der", .)
(2 real changes made)

.         replace street = subinstr(street, "Alb.", "Albert", .)     
(10 real changes made)

.         replace street = subinstr(street, "b.", "burger", .)     
(1 real change made)

.         replace street = subinstr(street, "-Bog", "Bogen", .)     
(61 real changes made)

.         replace street = subinstr(street, "B.", "Bogen", .)     
(1 real change made)

.         replace street = subinstr(street, "Br.", "Brücke", .)     
(0 real changes made)

.         replace street = subinstr(street, "Bog.", "Bogen", .)     
(0 real changes made)

.         replace street = subinstr(street, "Bogenen", "Bogen", .)     
(57 real changes made)

.         replace street = subinstr(street, "Wink.", "Winkel", .)     
(1 real change made)

.         replace street = subinstr(street, "A.", "An", .)     
(1 real change made)

.         replace street = subinstr(street, "-S.", "-Str.", .)     
(3 real changes made)

.         replace street = subinstr(street, "-Rg.", "Ring", .)     
(12 real changes made)

.         replace street = subinstr(street, "-Rg", "Ring", .)     
(11 real changes made)

.         replace street = subinstr(street, "v.", "von", .)     
(2 real changes made)

.         replace street = subinstr(street, "-v-", "von", .)     
(14 real changes made)

.         replace street = subinstr(street, "Wg", "Weg", .)    if  substr(street, strlen(street)-1
> , 2) =="Wg"
(0 real changes made)

.         replace street = subinstr(street, "W.", "Weg", .)    if  substr(street, strlen(street)-1
> , 2) =="W."
(0 real changes made)

.         replace street = subinstr(street, "W", "Weg", .)    if  substr(street, strlen(street), 1
> ) =="W"
(0 real changes made)

.         replace street = subinstr(street, "wg", "weg", .)    if  substr(street, strlen(street)-1
> , 2) =="wg"
(0 real changes made)

.         replace street = subinstr(street, "P", "Platz", .)    if  substr(street, strlen(street),
>  1) =="P"
(0 real changes made)

.         replace street = subinstr(street, "St", "Straße", .)    if  substr(street, strlen(street
> )-1, 2) =="St"
(2 real changes made)

. 
.         replace street="An der Streicherbreiten" if street=="A.d.Streicherbreiten"
(0 real changes made)

.         replace street="An der Hauptfeuerwache" if street=="And.Hauptfeuerwache"
(0 real changes made)

. 
. * Further Change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(76 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(97 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(89 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(295 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(158 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,624 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(2,916 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,632 real changes made)

.         replace street = subinstr(street,"Straße","Strasse",.)
(2,929 real changes made)

. 
.         replace street = street + "asse" if lower(substr(street, strlen(street)-2, 3)) =="str"
(121 real changes made)

.         replace street = street + "atz" if lower(substr(street, strlen(street)-1, 2)) =="pl"
(4 real changes made)

. 
.         replace street="Allensteiner Strasse" if street=="AlleensteinerStrasse"
(1 real change made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(7 real changes made)

. 
. 
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(7 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(41 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(11,739 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,771 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(3 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(305 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(318 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(426 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(495 real changes made)

.         
. 
. * different from later years: segments not only defined by "-", but also by "from" ("ab"), "even
> " ("gerade"), "odd" ("unger."), "consecutive" ("fortl.")
.         gen ab = strpos(hnr_orig_segment, "ab")

.         gen even = strpos(hnr_orig_segment, "gerade")

.         gen odd = strpos(hnr_orig_segment, "unger.")

.         gen fort = strpos(hnr_orig_segment, "fortl.")

.         gen minus = strpos(hnr_orig_segment, "-")

. 
.         assert ab==1 | ab==0

.         assert even==0 & odd==0 if fort>0

.         assert even==0 & fort==0 if odd>0

.         assert odd==0 & fort==0 if even>0

.         assert fort==even==odd==0 if ab==0& minus==0

. 
. ** Extract address numbers from entries, e.g.,  '2-4gerade', 'ab26fortl.' etc.
. *       gen hnr_min / hnr_max := start number in given street 
. *       gen buchstaben_min /buchstaben_max := (optional) letter attachted to street number, e.g.
> , 44A 
. *       when whole street is assigned to a precinct, hnr_orig_segment is empty
. 
. * get starting number
.         *from case
.         gen hnr_orig_segment1 = substr(hnr_orig_segment, ab+2, .) if ab==1
(8,780 missing values generated)

.         * "-" (minus) case"
.         replace hnr_orig_segment1 = substr(hnr_orig_segment, 1, minus-1) if ab==0
(4,497 real changes made)

.         *"raw" case: only one number given
.         *that is different to later years. it is possible that a singleton address is stated (6 
> instead of 6-6)
.         replace hnr_orig_segment1 = hnr_orig_segment if ab==0 & minus==0
(753 real changes made)

. *assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment1)

. 
. * get ending number
.         gen hnr_orig_segment2 = substr(hnr_orig_segment, minus+1, .) if ab==0
(6,495 missing values generated)

. *assert that all cases are considered
.         assert missing(hnr_orig_segment)==missing(hnr_orig_segment2) | ab==1

.         drop if hnr_orig_segment2 == "0" // drop if 0 is the number (does not exist)
(73 observations deleted)

. 
.         *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

. 
. * change that not for all addresses a maximum number is given
. *singleton addresses
.         assert hnr_orig_segment==hnr_orig_segment1 if ab==0 & minus==0

.         replace hnr_orig_segment2 = hnr_orig_segment if ab==0 & minus==0
(0 real changes made)

. *and that not necessarily no maximum is given
.         assert  missing(hnr_orig_segment2) if missing(hnr_orig_segment)

.         replace hnr_orig_segment2 = "320" if missing(hnr_orig_segment2) & even>0
(1,100 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & odd>0
(1,069 real changes made)

.         replace hnr_orig_segment2 = "321" if missing(hnr_orig_segment2) & fort>0
(796 real changes made)

. 
. * take only numeric part from the starting and ending hnr
. *first drop known strings
.         foreach c in "gerade" "unger." "fortl." {
  2.                 replace hnr_orig_segment1 = subinstr(hnr_orig_segment1,"`c'","",.)
  3.                 replace hnr_orig_segment2 = subinstr(hnr_orig_segment2,"`c'","",.)
  4.         }
(1,100 real changes made)
(1,516 real changes made)
(1,069 real changes made)
(1,548 real changes made)
(796 real changes made)
(1,433 real changes made)

. *then generate numierc part
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,530 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,530 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,481 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,086 missing values generated)

.         replace buchstaben_min=lower(buchstaben_min)
(191 real changes made)

.         replace buchstaben_max=lower(buchstaben_max)
(586 real changes made)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3530 missing values generated)
hnr_max: all characters numeric; replaced as int
(3530 missing values generated)

. 
. 
. ************************************************************************
. **** 2. start generating addresses// from here very similar to the other elections
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case0: streets without numbers
.         keep if missing(hnr_orig_segment)
(8,142 observations deleted)
.         
. * keep variables
.         keep stadtbez sb merge_strasse
.         
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,129,600 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: assert _N==321
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(29,461,380 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,133,130 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,133,130 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,133,130 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,133,130 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,133,130 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,133,130 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,133,130 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,133,130 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,133,130 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,133,130 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,133,130 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,133,130 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,133,130 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,133,130 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,133,130 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,133,130 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,133,130 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,133,130 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,133,130 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,133,130 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,133,130 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,133,130 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,133,130 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,133,130 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,133,130 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,133,130 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,133,130 real changes made)
.         
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format
. }

. 
. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,530 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
. * destring 
.         destring hnr_min hnr_max, replace
hnr_min already numeric; no replace
hnr_max already numeric; no replace

. 
. *addresses with high numbers and ab/from corrected manually
.         replace hnr_max = 337 if hnr_orig_segment=="ab333unger." & merge_strasse=="fuerstenriede
> rstrasse"
(1 real change made)

.         replace hnr_max = 425 if hnr_orig_segment=="ab365unger." & merge_strasse=="riemerstrasse
> "
(1 real change made)

.         replace hnr_max = 570 if hnr_orig_segment=="ab542gerade" & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 394 if hnr_orig_segment=="ab384fortl." & merge_strasse=="balanstrasse"
(1 real change made)

.         replace hnr_max = 386 if hnr_orig_segment=="ab340gerade" & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 391 if hnr_orig_segment=="ab345unger." & merge_strasse=="hoeglwoerther
> strasse"
(1 real change made)

.         replace hnr_max = 529 if hnr_orig_segment=="ab515unger." & merge_strasse=="landsbergerst
> rasse"
(1 real change made)

.         replace hnr_max = 443 if hnr_orig_segment=="ab400fortl." & merge_strasse=="feldmochinger
> strasse"
(1 real change made)

.         replace hnr_max = 667 if hnr_orig_segment=="ab641unger." & merge_strasse=="dachauerstras
> se"
(1 real change made)

.         replace hnr_max = 334 if hnr_orig_segment=="ab332gerade" & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         replace hnr_max = 345 if hnr_orig_segment=="ab335unger." & merge_strasse=="lerchenauerst
> rasse"
(1 real change made)

.         assert hnr_min<=hnr_max

. 
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(8,142 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(8,142 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(8,142 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(8,142 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(8,142 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(680 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format
. }

.         
.         
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * generate a variable containing how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * generate for each number a segment contains duplicates 
.         expand tmp1
(934,906 observations created)

.         drop tmp1

. 
. * tmp3: generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(825,098 real changes made)

. 
. * segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd>0 & mod(tmp3, 2) == 0
(168,771 observations deleted)

.         drop if even>0 & mod(tmp3, 2) == 1
(171,735 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(23,054 observations deleted)
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(15,066,688 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(579,488 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(579,488 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(579,488 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(579,488 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(579,488 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(579,488 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(579,488 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(579,488 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(579,488 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(579,488 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(579,488 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(579,488 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(579,488 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(579,488 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(579,488 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(579,488 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(579,488 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(579,488 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(579,488 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(579,488 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(579,488 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(579,488 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(579,488 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(579,488 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(579,488 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(579,488 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(579,488 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(579,488 observations deleted)

. 
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(6,263 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(4,158 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(1,683 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1,826 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(300 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(327 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(22 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(436,566 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(453,357 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(224 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(16,633 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(16,753 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(16,776 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(16,787 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(16,788 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(16,790 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(16,790 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(16,790 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(16,790 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(16,790 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(16,790 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(16,791 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(16,791 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(16,791 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(16,791 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(16,791 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(16,791 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(16,791 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(16,791 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(16,791 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(16,791 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(16,791 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(16,791 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(16,791 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(16,791 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(16,791 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(16,791 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(16,933 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,485 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(1,292 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(742 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(173 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(58 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(36 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(77 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(73 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(13 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
variable tmp_buch was str1 now str2
(1 real change made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(20 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(159,146 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         replace buchstabe = buchstabe-1
(165,267 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(13,382 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(6,121 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(6,121 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,781 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,673 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,616 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(5,598 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(5,587 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(5,580 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(5,574 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(5,572 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(5,570 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(5,570 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(5,569 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(5,569 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(5,568 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(5,568 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(5,568 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(5,568 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(5,568 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(5,568 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(5,568 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(5,568 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(5,568 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(5,568 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(5,568 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(5,568 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(5,568 real changes made)
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(22,912 observations deleted)

.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(125 observations deleted)
.         gen buchstabe = buchstaben_min
.         
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max 
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(139 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(1 missing value generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(0 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(1 real change made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(3 missing values generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(1 real change made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(0 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(2 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(75 observations created)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==26)
.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n
.         drop if buchstabe < tmp_buch
(2 observations deleted)
.         drop if buchstabe > tmp_buch2
(68 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str1
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(2 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(2 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(2 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(0 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(0 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(0 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(0 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(0 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(0 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(0 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(20 observations deleted)

. 
.         
. *last remaining case (case6): first and second mentioned address contain letter and both have di
> fferent numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(73 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(59 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(14 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(47 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(15 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(28 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(4 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(3,172 observations created)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: assert(_N==27)

.         bys stadtbez merge_strasse hnr ab even odd fort minus hnr_min hnr_max: gen buchstabe = _
> n

.         replace buchstabe = buchstabe-1
(3,294 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(20 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(312 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(109 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(117 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(115 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(113 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(110 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(109 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(109 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(109 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(109 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(109 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(109 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(109 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(109 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(109 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(109 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(109 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(109 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(109 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(109 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(109 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(109 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(109 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(109 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(109 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(109 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(109 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(109 real changes made)

. 
. * keep only relevant variables
.         drop ab even odd fort minus hnr_min hnr_max buchstaben_min buchstaben_max tmp_buch tmp_b
> uch2

.   
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    46,833,086
        from master                46,833,086  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases, where the correct precinct is known for sure
.         append using `exact'    

.         
.         
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(24 observations deleted)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(4,048 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_kow14_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_kow14_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_kow14_voll_buchsta
    > be.dta saved

. 
end of do-file
Running: 02d_import_btw17.do

. /*
> Input: BTW2017_Straßenverzeichnis.xlsx
>         > electoral roll 2017: raw addresses of all eligible voters and their assigned precinct
> 
> Output: tmp/strassen_btw17_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and prepare for merging
>         > extend to single addresses as only address segments are given (e.g., No 8-16)
> 
>                         . address named exactly (border cases of the segments: if 6-10a -> 6 and
>  10a)
>                         1. beginning and ending of address contain only numbers and no letters (
> e.g., 1-15)
>                          If segments with letters, different cases:
>                                 2. only beginning of the segment contains a letter (e.g., 16a-24
> )
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                                 If segments contain letter at the beginning and the ending, diff
> erent cases:
>                                 4. assignment given for exactly one address (same street and sam
> e letter), e.g. 16a-16a
>                                 5. assignment given for exactly one street (but with different a
> ddresses (letters)), e.g. 17b-17e
>                                 6. first and second mentioned address contain letter and both ha
> ve different numbers (e.g., 8b-11d)
> 
> */
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. import excel using "$rawdata/election_office/electoral_rolls/BTW2017_Straßenverzeichnis.xlsx", c
> lear
(5 vars, 26,222 obs)

. 
. *clean file and rename
.         replace A = subinstr(A, "‐", "-", .)
(3,608 real changes made)

.         replace B = subinstr(B, "‐", "-", .)
(25,625 real changes made)

.         tab C

          C |      Freq.     Percent        Cum.
------------+-----------------------------------
        217 |      5,460       20.82       20.82
        218 |      7,124       27.17       47.99
        219 |      5,929       22.61       70.60
        220 |      7,112       27.12       97.72
         WK |        597        2.28      100.00
------------+-----------------------------------
      Total |     26,222      100.00

.         drop if A=="STRASSE"
(597 observations deleted)

.         rename A street

.         label var street "raw street from official source"

.         rename B hnr_orig_segment

.         rename C wahlkreis_btw17

.         rename D stadtbez

.         lab var stadtbez "city district ID"

.         rename E sb

.         lab var sb "raw precinct id"

. 
. /* This is what the first five rows look like. (for comparison to 2009, 2013, 2014) (very simila
> r to 2018, 2019, and 2020)
> 
> strasse hnr_orig_segment        wahlkreis_btw17 stadtbez        sb
> Aberlestr.      43   -   47     219     6       6013
> Abtstr. 1   -    3      217     11      11014
> Abtstr. 2   -    6      217     11      11014
> Abtstr. 11   -   11a    217     11      11015
> Abtstr. 12   -   14     217     11      11014
> 
> */
. 
. /*Check if "St." stands for "Sankt" in all cases // checked
>         gen tmp1 = strpos(strasse, "St.")
>         tab tmp1
>         *br if tmp1>0
>         drop tmp1
> */
. 
. *Change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(166 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(193 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(176 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(752 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(376 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(14,567 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(6,524 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(14,567 real changes made)

.         replace street = subinstr(street,"Straße","Strasse",.)
(6,524 real changes made)

. 
.         replace street="Allensteiner Strasse" if street=="Alleensteiner Strasse"
(3 real changes made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(14 real changes made)

. 
.         
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(20 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(3 real changes made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(5,121 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(25,612 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(3,608 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(0 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(10 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(611 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(724 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(984 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(1,076 real changes made)

.         
. 
. 
. *drop spaces in segments
.         replace hnr_orig_segment = subinstr(hnr_orig_segment, " ", "", .)
(25,620 real changes made)

. 
. *split segments into single components
. *       Note: hnr_orig_segment singletons are in format 15-15
.         split hnr_orig_segment, p("-")
variables created as string: 
hnr_orig_s~1  hnr_orig_s~2

.         *manually correct misspecified segments
.         replace hnr_orig_segment2 = "321" if merge_strasse=="widmannstrasse" & hnr_orig_segment2
> =="030"
(1 real change made)

.         replace hnr_orig_segment1 = "19b" if merge_strasse=="widmannstrasse" & hnr_orig_segment1
> =="1,90E"
(1 real change made)

.         replace hnr_orig_segment2 = "27" if merge_strasse=="matterhornstrasse" & hnr_orig_segmen
> t2=="024"
(1 real change made)

.         replace hnr_orig_segment1 = "19d" if merge_strasse=="matterhornstrasse" & hnr_orig_segme
> nt1=="1,90E"
(1 real change made)

.         replace hnr_orig_segment2 = "33" if merge_strasse=="triebstrasse" & hnr_orig_segment2=="
> 020"
(1 real change made)

.         replace hnr_orig_segment1 = "11b" if merge_strasse=="triebstrasse" & hnr_orig_segment1==
> "1,10E"
(1 real change made)

.         replace hnr_orig_segment2 = "39" if merge_strasse=="hansastrasse" & hnr_orig_segment2=="
> 038"
(1 real change made)

.         replace hnr_orig_segment1 = "27e" if merge_strasse=="hansastrasse" & hnr_orig_segment1==
> "2,70E"
(1 real change made)

.         replace hnr_orig_segment2 = "32" if merge_strasse=="aufsesserstrasse" & hnr_orig_segment
> 2=="018"
(1 real change made)

.         replace hnr_orig_segment1 = "4e" if merge_strasse=="aufsesserstrasse" & hnr_orig_segment
> 1=="4,00E"
(1 real change made)

.         drop if merge_strasse=="schlossnymphenburg" & hnr_orig_segment2=="0" // not existing in 
> other years
(1 observation deleted)

.         
. *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

.         // assert only one split 
.         cap confirm var hnr_orig_segment3

.         assert _rc

.         // assert: hnr_orig_segment1 and hnr_orig_segment2 are non-missing (unless no street num
> ber given at all)
.         assert !missing(hnr_orig_segment1) == !missing(hnr_orig_segment2)

. 
. * get numeric part from single components (first and second (=last))
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(24,961 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(23,334 missing values generated)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
hnr_max: all characters numeric; replaced as int

.         assert hnr_min<=hnr_max

. 
. * generate which numbers from the single components are even/odd
. *       even-even (e.g., 2-16) and odd-odd (1-17) refer to opposite sides of a street
. *       Note: no cases of even-odd or odd-even
. *       Note: if any hnr_orig_segment is missing vars even and odd are 0
.         gen even = (mod(hnr_min, 2) == 0 & mod(hnr_max, 2) == 0) // Dummy=1 if min & max = even,
>  0 else (odd/no hnr_orig_segment) // single digit addresses always given as 15-15

.         gen odd = (mod(hnr_min, 2) == 1 & mod(hnr_max, 2) == 1)

.         assert even+odd==1 if !missing(hnr_orig_segment) // (no cases of odd-even or even-odd)

. 
. 
.         
. ************************************************************************
. **** 2. start generating addresses
. ************************************************************************
. * assert that the case without any numbers does not exist (only street name)
.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(25,624 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(25,624 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(25,624 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(25,624 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(25,624 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(4,423 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format
. }

. 
. 
. 
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * generate a variable containing how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * generate for each number a segment contains duplicates 
.         expand tmp1
(226,470 observations created)

.         drop tmp1

. 
. * generate the address number
.         bys merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min if hnr_min != .
(213,638 real changes made)

. 
. *some segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd==1 & mod(tmp3, 2) == 0
(56,627 observations deleted)

.         drop if even==1 & mod(tmp3, 2) == 1
(56,608 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
. 
. 
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(12,429 observations deleted)
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(3,287,180 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(126,430 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(126,430 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(126,430 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(126,430 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(126,430 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(126,430 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(126,430 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(126,430 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(126,430 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(126,430 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(126,430 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(126,430 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(126,430 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(126,430 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(126,430 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(126,430 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(126,430 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(126,430 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(126,430 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(126,430 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(126,430 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(126,430 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(126,430 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(126,430 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(126,430 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(126,430 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(126,430 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format
. }

. 
. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(126,430 observations deleted)

. 
.         
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
. keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(9,639 observations deleted)
. 
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(940 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(640 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(157 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(76 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(22 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(12 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(19 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(3 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(11 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(72,540 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(75,330 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(636 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(2,366 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(2,666 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(2,747 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(2,773 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2,782 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(2,784 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(2,785 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(2,787 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(2,788 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(2,788 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(2,788 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(2,790 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(2,790 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(2,790 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(2,790 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(2,790 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(2,790 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(2,790 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(2,790 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(2,790 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(2,790 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(2,790 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(2,790 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(2,790 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(2,790 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(2,790 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(2,790 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
. }

. 
. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(3,289 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(3,049 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(1,724 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(723 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(267 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(110 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(93 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(65 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(20 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(16 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
variable tmp_buch was str1 now str2
(4 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
(6 real changes made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(18 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(1 real change made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(2 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(237,640 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(246,780 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(49,927 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(9,140 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(9,140 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(7,783 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(7,404 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(7,230 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(7,165 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(7,137 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(7,115 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(7,103 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(7,100 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(7,097 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(7,095 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(7,092 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(7,092 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(7,091 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(7,090 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(7,089 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(7,089 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(7,089 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(7,089 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(7,089 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(7,089 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(7,089 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(7,089 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(7,089 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(7,089 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(7,089 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(11,930 observations deleted)

. 
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(366 observations deleted)
.         gen buchstabe = buchstaben_min
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(460 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(12 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(3 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(6 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(1 real change made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(1 real change made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(1 real change made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(39 missing values generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(13 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(6 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(8 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(7 real changes made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(2 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
variable tmp_buch2 was str1 now str2
(1 real change made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(2 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(975 observations created)
.         bys stadtbez merge_strasse hnr: assert(_N==26)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         drop if buchstabe < tmp_buch
(31 observations deleted)
.         drop if buchstabe > tmp_buch2
(859 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str2
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(27 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(30 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(23 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(18 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(10 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(3 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(2 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(3 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(3 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(3 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(2 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(172 observations deleted)

. 
. 
. *last remaining case (case6): first and second mentioned addresses contain letter and both have 
> different numbers (e.g., 8b-11d)
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(183 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(94 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(28 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(26 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(17 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(8 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(2 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(8 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(87 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(40 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(17 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(19 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(8 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(3 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(8,502 observations created)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n

.         replace buchstabe = buchstabe-1
(8,829 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(147 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(1,618 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

. 
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(260 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(294 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(267 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(268 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(264 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(259 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(257 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(258 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(259 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(259 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(259 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(260 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(260 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(260 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(260 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(260 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(260 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(260 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(260 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(260 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(260 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(260 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(260 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(260 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(260 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(260 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(260 real changes made)

. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2

. 
.    
. *append all datasets created before   
.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                     3,645,252
        from master                 3,645,252  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases where the correct precinct is known for sure
.         append using `exact'    

.         
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         replace sb = substr(sb, strlen(sb)-1, 2)
(3,692,077 real changes made)

.         replace sb = stadtbez + sb
(3,692,077 real changes made)

.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(11,001 observations deleted)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(11,378 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_btw17_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_btw17_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_btw17_voll_buchsta
    > be.dta saved

. 
end of do-file
Running: 02e_import_ltw18.do

. /*
> Input: LTW2018_Straßenverzeichnis.xlsx
>         > electoral roll 2018: raw addresses of all eligible voters and their assigned precinct
> 
> Output: tmp/strassen_ltw18_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and prepare for merging
>         > extend to single addresses as only address segments are given (e.g., No 8-16)
> 
>                         0. streets without any numbers // not the case in 2017
>                         . address named exactly (border cases of the segments: if 6-10a -> 6 and
>  10a)
>                         1. beginning and ending of address contain only numbers and no letters (
> e.g., 1-15)
>                          If segments with letters, different cases:
>                                 2. only beginning of the segment contains a letter (e.g., 16a-24
> )
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                                 If segments contain letter at the beginning and the ending, diff
> erent cases:
>                                 4. assignment given for exactly one address (same street and sam
> e letter), e.g., 16a-16a
>                                 5. assignment given for exactly one street (but with different a
> ddresses (letters)), e.g., 17b-17e
>                                 6. first and second mentioned address contain letter and both ha
> ve different numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. import excel using "$rawdata/election_office/electoral_rolls/LTW2018_Straßenverzeichnis.xlsx", c
> lear
(5 vars, 12,173 obs)

. 
. *clean file and rename
.         replace A = subinstr(A, "‐", "-", .)
(1,821 real changes made)

.         replace B = subinstr(B, "‐", "-", .)
(8,058 real changes made)

.         drop if A=="Strasse"
(279 observations deleted)

. 
.         rename A street

.         label var street "raw street from official source"

.         rename B hnr_orig_segment

.         rename C wahlkreis_ltw18

.         rename D stadtbez

.         lab var stadtbez "city district ID"

.         rename E sb

.         lab var sb "raw precinct id"

. 
. *Change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(76 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(82 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(76 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(367 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(204 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,693 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(3,026 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,693 real changes made)

.         replace street = subinstr(street,"Straße","Strasse",.)
(3,026 real changes made)

. 
.         replace street="Allensteiner Strasse" if street=="Alleensteiner Strasse"
(1 real change made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(5 real changes made)

. 
.         
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(13 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(2,266 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(11,889 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,821 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(0 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(297 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(331 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(424 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(507 real changes made)

.         
. *drop spaces in segments
.         replace hnr_orig_segment = subinstr(hnr_orig_segment, " ", "", .)
(8,058 real changes made)

. 
. *split segments into single components
. *       Note: hnr_orig_segment singletons are in format 15-15
.         split hnr_orig_segment, p("-")
variables created as string: 
hnr_orig_s~1  hnr_orig_s~2

.         *manually correct misspecified segments
.         replace hnr_orig_segment2 = "321" if merge_strasse=="widmannstrasse" & hnr_orig_segment2
> =="030"
(1 real change made)

.         replace hnr_orig_segment2 = "32" if merge_strasse=="aufsesserstrasse" & hnr_orig_segment
> 2=="018"
(1 real change made)

.         replace hnr_orig_segment1 = "4e" if merge_strasse=="aufsesserstrasse" & hnr_orig_segment
> 1=="4,00E"
(1 real change made)

.         replace hnr_orig_segment2 = "39" if merge_strasse=="hansastrasse" & hnr_orig_segment2=="
> 106"
(1 real change made)

.         replace hnr_orig_segment1 = "27e" if merge_strasse=="hansastrasse" & hnr_orig_segment1==
> "2,70E"
(1 real change made)

.         expand 2 if merge_strasse=="hansastrasse" & hnr_orig_segment1=="27e"
(1 observation created)

.         bys merge_strasse hnr_orig_segment: gen tmp1 =_n

.         replace hnr_orig_segment = "46-106" if merge_strasse=="hansastrasse" & hnr_orig_segment2
> =="39" & tmp1==2
(1 real change made)

.         replace hnr_orig_segment2 = "106" if merge_strasse=="hansastrasse" & hnr_orig_segment2==
> "39" & tmp1==2
(1 real change made)

.         replace hnr_orig_segment1 = "46" if merge_strasse=="hansastrasse" & hnr_orig_segment1=="
> 27e" & tmp1==2
(1 real change made)

.         drop tmp1

. 
. *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

.         // assert only one split 
.         cap confirm var hnr_orig_segment3

.         assert _rc

.         // assert: hnr_orig_segment1 and hnr_orig_segment2 are non-missing (unless no street num
> ber given at all)
.         assert !missing(hnr_orig_segment1) == !missing(hnr_orig_segment2)

. 
. * get numeric part from single components (first and second (=last))
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,836 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,836 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,689 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,298 missing values generated)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3836 missing values generated)
hnr_max: all characters numeric; replaced as int
(3836 missing values generated)

. 
. * generate which numbers from the single components are even/odd
. *       even-even (e.g., 2-16) and odd-odd (1-17) refer to opposite sides of a street
. *       Note: no cases of even-odd or odd-even
. *       Note: if any hnr_orig_segment is missing vars even and odd are 0
.         gen even = (mod(hnr_min, 2) == 0 & mod(hnr_max, 2) == 0) // Dummy=1 if min & max = even,
>  0 else (odd/no hnr_orig_segment) // single digit addresses always given as 15-15

.         gen odd = (mod(hnr_min, 2) == 1 & mod(hnr_max, 2) == 1)

.         assert even+odd==1 if !missing(hnr_orig_segment) // (no cases of odd-even or even-odd)

. 
. * slightly different from 2017 (some segments contain only streets without any numbers)
.         replace even=. if missing(hnr_orig_segment)
(3,836 real changes made, 3,836 to missing)

.         replace odd=. if missing(hnr_orig_segment)
(3,836 real changes made, 3,836 to missing)

. 
. 
. ************************************************************************
. **** 2. start generating addresses
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case0: streets without numbers
.         keep if missing(hnr_orig_segment)
(8,059 observations deleted)
. 
. * keep variables
.         keep stadtbez sb merge_strasse
. 
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,227,520 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: assert _N==321
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(32,015,256 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,231,356 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,231,356 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,231,356 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,231,356 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,231,356 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,231,356 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,231,356 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,231,356 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,231,356 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,231,356 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,231,356 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,231,356 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,231,356 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,231,356 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,231,356 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,231,356 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,231,356 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,231,356 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,231,356 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,231,356 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,231,356 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,231,356 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,231,356 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,231,356 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,231,356 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,231,356 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,231,356 real changes made)
. 
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,836 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(8,059 observations created)
. 
. * gen identifier for first and second part (hnr_orig_segment1 and hnr_orig_segment2 due to manua
> lly correction before)
.         bys stadtbez sb merge_strasse hnr_orig_segment1 hnr_orig_segment2: gen tmp1 = _n // 1 or
>  2
.         bys stadtbez sb merge_strasse hnr_orig_segment1 hnr_orig_segment2: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(8,059 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(8,059 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(8,059 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(8,059 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(664 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format
. }

. 
. 
. * destring 
.         destring hnr_min hnr_max, replace
hnr_min already numeric; no replace
hnr_max already numeric; no replace

.         assert hnr_min<=hnr_max

.         
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * tmp1: county number of distinct street numbers b/w hnr_min and hnr_max generate a variable con
> taining how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * expand to number of distinct street numbers
.         expand tmp1
(160,906 observations created)

.         drop tmp1

. 
. * tmp3: generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(144,492 real changes made)

. 
. * segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd==1 & mod(tmp3, 2) == 0
(40,166 observations deleted)

.         drop if even==1 & mod(tmp3, 2) == 1
(40,287 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
.         
.         
. 
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(8,194 observations deleted)
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(2,088,268 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(80,318 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(80,318 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(80,318 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(80,318 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(80,318 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(80,318 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(80,318 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(80,318 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(80,318 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(80,318 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(80,318 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(80,318 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(80,318 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(80,318 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(80,318 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(80,318 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(80,318 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(80,318 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(80,318 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(80,318 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(80,318 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(80,318 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(80,318 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(80,318 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(80,318 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(80,318 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(80,318 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(80,318 observations deleted)

. 
.         
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(6,016 observations deleted)
. 
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(675 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(369 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(195 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(39 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(22 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(3 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(19 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(28 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(56,628 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(58,806 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(288 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(2,000 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(2,120 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(2,152 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(2,169 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2,172 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(2,174 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(2,175 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(2,177 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(2,177 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(2,177 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(2,177 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(2,178 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(2,178 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(2,178 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(2,178 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(2,178 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(2,178 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(2,178 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(2,178 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(2,178 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(2,178 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(2,178 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(2,178 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(2,178 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(2,178 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(2,178 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(2,178 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
. }

. 
. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(2,358 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,084 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(896 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(519 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(333 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(111 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(86 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(64 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(44 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(4 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
variable tmp_buch was str1 now str2
(3 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
(4 real changes made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(20 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(151,736 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(157,572 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(13,797 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(5,836 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(5,836 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,468 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,364 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,319 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(5,297 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(5,285 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(5,279 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(5,274 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(5,271 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(5,270 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(5,269 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(5,268 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(5,268 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(5,267 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(5,267 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(5,267 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(5,267 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(5,267 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(5,267 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(5,267 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(5,267 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(5,267 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(5,267 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(5,267 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(5,267 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(5,267 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(8,014 observations deleted)

.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(164 observations deleted)
.         gen buchstabe = buchstaben_min
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(179 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
.         replace tmp_buch = "2" if buchstaben_min=="b"
(0 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(1 missing value generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(0 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(0 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(0 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(1 real change made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(25 observations created)
.         bys stadtbez merge_strasse hnr: assert(_N==26)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         drop if buchstabe < tmp_buch
(0 observations deleted)
.         drop if buchstabe > tmp_buch2
(21 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str1
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(1 real change made)
.         replace buchstabe="b" if buchstabe=="2"
(1 real change made)
.         replace buchstabe="c" if buchstabe=="3"
(1 real change made)
.         replace buchstabe="d" if buchstabe=="4"
(1 real change made)
.         replace buchstabe="e" if buchstabe=="5"
(1 real change made)
.         replace buchstabe="f" if buchstabe=="6"
(0 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(0 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(0 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(0 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(0 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(0 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2
. 
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(17 observations deleted)

. 
. 
. *last remaining case (case6): first and second mentioned address contain letter and both have di
> fferent numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(30 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(30 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(32 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(26 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(4 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(2 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(4,238 observations created)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n

.         replace buchstabe = buchstabe-1
(4,401 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(13 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(269 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(152 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(161 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(155 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(154 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(153 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(152 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(152 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(152 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(152 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(152 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(152 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(152 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(152 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(152 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(152 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(152 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(152 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(152 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(152 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(152 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(152 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(152 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(152 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(152 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(152 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(152 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(152 real changes made)

. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2

. 
.    
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    35,606,177
        from master                35,606,177  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases where the correct precinct is known for sure
.         append using `exact'    

. 
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         replace sb = substr(sb, strlen(sb)-1, 2)
(35,621,631 real changes made)

.         replace sb = stadtbez + sb
(35,621,631 real changes made)

.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(0 observations are duplicates)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(10,892 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_ltw18_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_ltw18_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_ltw18_voll_buchsta
    > be.dta saved

. 
. 
end of do-file
Running: 02f_import_euw19.do

. /*
> Input: EuW2019_Straßenverzeichnis.xlsx
>         > electoral roll 2019: raw addresses of all eligible voters and their assigned precinct
> 
> Output: tmp/strassen_euw19_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and prepare for merging
>         > extend to single addresses as only address segments are given (e.g., No 8-16)
> 
>                         0. streets without any numbers // not the case in 2017
>                         . address named exactly (border cases of the segments: if 6-10a -> 6 and
>  10a)
>                         1. beginning and ending of address contain only numbers and no letters (
> e.g., 1-15)
>                          If segments with letters, different cases:
>                                 2. only beginning of the segment contains a letter (e.g., 16a-24
> )
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                                 If segments contain letter at the beginning and the ending, diff
> erent cases:
>                                 4. assignment given for exactly one address (same street and sam
> e letter), e.g. 16a-16a
>                                 5. assignment given for exactly one street (but with different a
> ddresses (letters)), e.g. 17b-17e
>                                 6. first and second mentioned address contain letter and both ha
> ve different numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. import excel using "$rawdata/election_office/electoral_rolls/EuW2019_Straßenverzeichnis.xlsx", c
> lear
(4 vars, 12,190 obs)

. 
. *clean file and rename
.         replace A = subinstr(A, "‐", "-", .)
(1,817 real changes made)

.         replace B = subinstr(B, "‐", "-", .)
(8,007 real changes made)

.         tab C

          C |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        290        2.38        2.38
         10 |        414        3.40        5.78
         11 |        424        3.48        9.27
         12 |        578        4.75       14.02
         13 |        734        6.03       20.05
         14 |        285        2.34       22.39
         15 |        739        6.07       28.46
         16 |        746        6.13       34.59
         17 |        331        2.72       37.31
         18 |        515        4.23       41.54
         19 |        843        6.93       48.46
          2 |        303        2.49       50.95
         20 |        405        3.33       54.28
         21 |        804        6.61       60.89
         22 |        511        4.20       65.08
         23 |        447        3.67       68.76
         24 |        486        3.99       72.75
         25 |        431        3.54       76.29
          3 |        335        2.75       79.04
          4 |        365        3.00       82.04
          5 |        373        3.06       85.11
          6 |        221        1.82       86.92
          7 |        444        3.65       90.57
          8 |        145        1.19       91.76
          9 |        697        5.73       97.49
         SB |        306        2.51      100.00
------------+-----------------------------------
      Total |     12,172      100.00

.         drop if A=="Strasse"
(306 observations deleted)

.         drop if missing(A)
(18 observations deleted)

. 
.         rename A street

.         label var street "raw street from official source"

.         rename B hnr_orig_segment

.         rename C stadtbez

.         lab var stadtbez "city district ID"

.         rename D sb

.         lab var sb "raw precinct id"

. 
. *Change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(76 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(82 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(76 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(365 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(206 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,677 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(3,013 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,677 real changes made)

.         replace street = subinstr(street,"Straße","Strasse",.)
(3,013 real changes made)

. 
.         replace street="Allensteiner Strasse" if street=="Alleensteiner Strasse"
(1 real change made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(5 real changes made)

. 
.         
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(11 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(2,263 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(11,861 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,817 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(0 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(297 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(327 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(426 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(508 real changes made)

. 
. *drop spaces in segments
.         replace hnr_orig_segment = subinstr(hnr_orig_segment, " ", "", .)
(8,007 real changes made)

. 
. *split segments into single components
. *       Note: hnr_orig_segment singletons are in format 15-15
.         split hnr_orig_segment, p("-")
variables created as string: 
hnr_orig_s~1  hnr_orig_s~2

. 
.         *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

.         // assert only one split 
.         cap confirm var hnr_orig_segment3

.         assert _rc

.         // assert: hnr_orig_segment1 and hnr_orig_segment2 are non-missing (unless no street num
> ber given at all)
.         assert !missing(hnr_orig_segment1) == !missing(hnr_orig_segment2)

. 
. * get numeric part from single components (first and second (=last))
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,859 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,859 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,660 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,264 missing values generated)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3859 missing values generated)
hnr_max: all characters numeric; replaced as int
(3859 missing values generated)

. 
. * generate which numbers from the single components are even/odd
. *       even-even (e.g., 2-16) and odd-odd (1-17) refer to opposite sides of a street
. *       Note: no cases of even-odd or odd-even
. *       Note: if any hnr_orig_segment is missing vars even and odd are 0
.         gen even = (mod(hnr_min, 2) == 0 & mod(hnr_max, 2) == 0) // Dummy=1 if min & max = even,
>  0 else (odd/no hnr_orig_segment) // single digit addresses always given as 15-15

.         gen odd = (mod(hnr_min, 2) == 1 & mod(hnr_max, 2) == 1)

.         assert even+odd==1 if !missing(hnr_orig_segment) // (no cases of odd-even or even-odd)

. 
. * set vars to missing when no street number given
.         replace even=. if missing(hnr_orig_segment)
(3,859 real changes made, 3,859 to missing)

.         replace odd=. if missing(hnr_orig_segment)
(3,859 real changes made, 3,859 to missing)

. 
. 
.         
. ************************************************************************
. **** 2. start generating addresses
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case0: streets without numbers
.         keep if missing(hnr_orig_segment)
(8,007 observations deleted)
. 
. * keep variables
.         keep stadtbez sb merge_strasse
.         
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,234,880 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: assert _N==321
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(32,207,214 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,238,739 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,238,739 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,238,739 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,238,739 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,238,739 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,238,739 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,238,739 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,238,739 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,238,739 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,238,739 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,238,739 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,238,739 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,238,739 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,238,739 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,238,739 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,238,739 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,238,739 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,238,739 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,238,739 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,238,739 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,238,739 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,238,739 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,238,739 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,238,739 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,238,739 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,238,739 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,238,739 real changes made)
. 
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,859 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expant for first or second part
.         expand 2
(8,007 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(8,007 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(8,007 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(8,007 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(8,007 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(655 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format
. }

. 
. 
. * destring 
.         destring hnr_min hnr_max, replace
hnr_min already numeric; no replace
hnr_max already numeric; no replace

.         assert hnr_min<=hnr_max

.         
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * tmp1: county number of distinct street numbers b/w hnr_min and hnr_max generate a variable con
> taining how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * expand to number of distinct street numbers
.         expand tmp1
(160,242 observations created)

.         drop tmp1

. 
. * tmp3: generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(143,883 real changes made)

. 
. * segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd==1 & mod(tmp3, 2) == 0
(39,881 observations deleted)

.         drop if even==1 & mod(tmp3, 2) == 1
(40,240 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

. 
. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(8,276 observations deleted)
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(2,076,152 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(79,852 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(79,852 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(79,852 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(79,852 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(79,852 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(79,852 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(79,852 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(79,852 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(79,852 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(79,852 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(79,852 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(79,852 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(79,852 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(79,852 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(79,852 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(79,852 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(79,852 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(79,852 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(79,852 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(79,852 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(79,852 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(79,852 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(79,852 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(79,852 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(79,852 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(79,852 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(79,852 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(79,852 observations deleted)

. 
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(6,115 observations deleted)
. 
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(660 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(348 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(195 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(42 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(25 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(3 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(19 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(28 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(56,186 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(58,347 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(290 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(1,983 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(2,103 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(2,134 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(2,151 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(2,155 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(2,157 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(2,158 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(2,160 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(2,160 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(2,160 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(2,160 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(2,161 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(2,161 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(2,161 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(2,161 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(2,161 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(2,161 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(2,161 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(2,161 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(2,161 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(2,161 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(2,161 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(2,161 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(2,161 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(2,161 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(2,161 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(2,161 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(2,341 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,081 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(883 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(519 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(339 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(111 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(86 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(68 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(44 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(4 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
variable tmp_buch was str1 now str2
(3 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
(4 real changes made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(20 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(154,310 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(160,245 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(13,917 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(5,935 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(5,935 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,562 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,459 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,414 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(5,392 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(5,380 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(5,374 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(5,368 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(5,365 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(5,364 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(5,363 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(5,362 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(5,362 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(5,361 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(5,361 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(5,361 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(5,361 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(5,361 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(5,361 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(5,361 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(5,361 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(5,361 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(5,361 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(5,361 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(5,361 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(5,361 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(8,096 observations deleted)

.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(164 observations deleted)
.         gen buchstabe = buchstaben_min
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assinment given for exactly one street (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(179 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
.         replace tmp_buch = "2" if buchstaben_min=="b"
(0 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(1 missing value generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(0 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(0 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(0 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(1 real change made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(25 observations created)
.         bys stadtbez merge_strasse hnr: assert(_N==26)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         drop if buchstabe < tmp_buch
(0 observations deleted)
.         drop if buchstabe > tmp_buch2
(21 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str1
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(1 real change made)
.         replace buchstabe="b" if buchstabe=="2"
(1 real change made)
.         replace buchstabe="c" if buchstabe=="3"
(1 real change made)
.         replace buchstabe="d" if buchstabe=="4"
(1 real change made)
.         replace buchstabe="e" if buchstabe=="5"
(1 real change made)
.         replace buchstabe="f" if buchstabe=="6"
(0 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(0 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(0 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(0 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(0 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(0 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(0 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(0 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(0 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(0 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(0 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(0 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(0 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(0 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2 
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(17 observations deleted)

. 
. *last remaining case (case6): first and second mentioned addresses contain letters and both have
>  different numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(30 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(30 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(32 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(26 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(4 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(2 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(4,238 observations created)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n

.         replace buchstabe = buchstabe-1
(4,401 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(13 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(269 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(152 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(161 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(155 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(154 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(153 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(152 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(152 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(152 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(152 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(152 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(152 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(152 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(152 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(152 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(152 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(152 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(152 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(152 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(152 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(152 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(152 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(152 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(152 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(152 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(152 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(152 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(152 real changes made)

. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_s
> egment2 tmp_buch tmp_buch2 

. 
.    
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    35,795,123
        from master                35,795,123  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases where the correct precinct is known for sure
.         append using `exact'    

. 
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
. * destring precinct and district ID
.         replace sb = substr(sb, strlen(sb)-1, 2)
(35,810,482 real changes made)

.         replace sb = stadtbez + sb
(35,810,482 real changes made)

.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(0 observations are duplicates)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(11,916 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_euw19_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_euw19_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_euw19_voll_buchsta
    > be.dta saved

. 
. 
end of do-file
Running: 02g_import_kow20.do

. /*
> Input: KommW2020_Straßenverzeichnis.xlsx
>         > electoral roll 2020: raw addresses of all eligible voters and their assigned precinct
> 
> Output: tmp/strassen_kow20_voll_buchstabe.dta
> 
> Main task:
>         > import, clean, and identify street segments that are assigned to a given precinct 
>                         -> a segment is equal to a streetname + range of numbers (e.g., Mystreet
>  6-18)
>                 >> note: a maximum number is not always given (e.g., singletons and "from 6 onwa
> rds" cases) 
>                         -> we generate max numbers by hand (e.g., 6 -> 6-6 and "from 6" -> 6-320
>  (hypothetical max))
>                 
>         > from street segments extend data to include each single address (e.g., Mystreet 6, Mys
> treet 8, etc.)
>                 -> several cases to be considered:
>                 0. streets without any numbers // not the case in 2017
>                  . address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
>                 1. beginning and ending of address contain only numbers and no letters (e.g., 1-
> 15)
>                  If segments with letters, different cases:
>                         2. only beginning of the segment contains a letter (e.g., 16a-24)
>                                 3. only ending of the segment contains a letter (e.g., 16-24f)
>                         If segments contain letter at the beginning and the ending, different ca
> ses:
>                         4. assignment given for exactly one address (same street and same letter
> ), e.g. 16a-16a
>                         5. assignment given for exactly one street (but with different addresses
>  (letters)), e.g. 17b-17e
>                         6. first and second mentioned address contain letter and both have diffe
> rent numbers (e.g., 8b-11d)
> 
> */
. 
. 
. 
. ************************************************************************
. **** 1. import, clean, and prepare for merging
. ************************************************************************
. import excel using "$rawdata/election_office/electoral_rolls/KommW2020_Straßenverzeichnis.xlsx",
>  clear
(4 vars, 12,513 obs)

. 
. *clean file and rename
.         replace A = subinstr(A, "‐", "-", .)
(1,933 real changes made)

.         replace B = subinstr(B, "‐", "-", .)
(8,362 real changes made)

.         drop if A=="Strasse"
(315 observations deleted)

. 
.         rename A street

.         label var street "raw street from official source"

.         rename B hnr_orig_segment

.         rename C stadtbez

.         lab var stadtbez "city district ID"

.         rename D sb

.         lab var sb "raw precinct id"

. 
. *Change street names for geocoding
.         replace street = subinstr(street,"St.","Sankt",.)
(87 real changes made)

.         replace street = subinstr(street,"Südl.","Südliche",.)
(0 real changes made)

.         replace street = subinstr(street,"Alle","Allee",.)
(89 real changes made)

.         replace street = subinstr(street,"Alleee","Allee",.)
(82 real changes made)

.         replace street = subinstr(street,"pl.","platz",.)
(379 real changes made)

.         replace street = subinstr(street,"Pl.","Platz",.)
(224 real changes made)

.         replace street = subinstr(street,"str.","straße",.)
(6,812 real changes made)

.         replace street = subinstr(street,"Str.","Straße",.)
(3,153 real changes made)

.         replace street = subinstr(street,"straße","strasse",.)
(6,812 real changes made)

.         replace street = subinstr(street,"Straße","Strasse",.)
(3,153 real changes made)

. 
.         replace street="Allensteiner Strasse" if street=="Alleensteiner Strasse"
(1 real change made)

.         replace street="Allescherstrasse" if street=="Alleescherstrasse"
(6 real changes made)

. 
. * gen: merge_strasse := harmonized street name
.         rename  street merge_strasse

.         lab var merge_strasse "harmonized street id for merging"

. 
.         replace merge_strasse = subinstr(merge_strasse,"Dr.","Doktor",.)
(10 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"Prof.","Professor",.)
(1 real change made)

.         replace merge_strasse = subinstr(merge_strasse," ","",.)
(2,333 real changes made)

.         replace merge_strasse = lower(merge_strasse)
(12,193 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"-","",.)
(1,933 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,".","",.)
(0 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"'","",.)
(4 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ß","ss",.)
(300 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ä","ae",.)
(338 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ö","oe",.)
(441 real changes made)

.         replace merge_strasse = subinstr(merge_strasse,"ü","ue",.)
(499 real changes made)

.         
. *drop spaces in segments
.         replace hnr_orig_segment = subinstr(hnr_orig_segment, " ", "", .)
(8,362 real changes made)

. 
. *split segments into single components
. *       Note: hnr_orig_segment singletons are in format 15-15
.         split hnr_orig_segment, p("-")
variables created as string: 
hnr_orig_s~1  hnr_orig_s~2

.         
.         *assert typical typos
.         assert substr(hnr_orig_segment2,1,1)!="0"

.         assert strpos(hnr_orig_segment1, ",")==0

.         // assert only one split 
.         cap confirm var hnr_orig_segment3

.         assert _rc

.         // assert: hnr_orig_segment1 and hnr_orig_segment2 are non-missing (unless no street num
> ber given at all)
.         assert !missing(hnr_orig_segment1) == !missing(hnr_orig_segment2)

.         
. * get numeric part from single components (first and second (=last))
.         gen hnr_min = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment1,"([0-9]+)")
(3,836 missing values generated)

.         gen hnr_max = real(ustrregexs(1)) if ustrregexm(hnr_orig_segment2,"([0-9]+)")
(3,836 missing values generated)

.         tostring hnr_min hnr_max, replace
hnr_min was float now str3
hnr_max was float now str3

. 
. * get remaining characters from single components (=address letters)
.         gen buchstaben_min = subinstr(hnr_orig_segment1, hnr_min, "", .)
(11,998 missing values generated)

.         gen buchstaben_max = subinstr(hnr_orig_segment2, hnr_max, "", .)
(11,560 missing values generated)

.         destring hnr_min hnr_max, replace
hnr_min: all characters numeric; replaced as int
(3836 missing values generated)
hnr_max: all characters numeric; replaced as int
(3836 missing values generated)

. 
. * generate which numbers from the single components are even/odd
. *       even-even (e.g., 2-16) and odd-odd (1-17) refer to opposite sides of a street
. *       Note: no cases of even-odd or odd-even
. *       Note: if any hnr_orig_segment is missing vars even and odd are 0
.         gen even = (mod(hnr_min, 2) == 0 & mod(hnr_max, 2) == 0) // Dummy=1 if min & max = even,
>  0 else (odd/no hnr_orig_segment) // single digit addresses always given as 15-15

.         gen odd = (mod(hnr_min, 2) == 1 & mod(hnr_max, 2) == 1)

.         assert even+odd==1 if !missing(hnr_orig_segment) // (no cases of odd-even or even-odd)

. 
. * set vars to missing when no street number given
.         replace even=. if missing(hnr_orig_segment)
(3,836 real changes made, 3,836 to missing)

.         replace odd=. if missing(hnr_orig_segment)
(3,836 real changes made, 3,836 to missing)

. 
. 
. 
. ************************************************************************
. **** 2. start generating addresses
. ************************************************************************
. //go through different cases
. frame copy default tmp, replace

. frame tmp {
. *case0: streets without numbers
.         keep if missing(hnr_orig_segment)
(8,362 observations deleted)
. 
. * keep variables
.         keep stadtbez sb merge_strasse
. 
. * create duplicates for each street to add numbers
.         expand 321 // 321 is chosen as no street contains a higher number (checked)
(1,227,520 observations created)
. 
. * generate address number
.         bys stadtbez merge_strasse: assert _N==321
.         bys stadtbez merge_strasse: gen hnr = _n
.         
. * create duplicates to add letters (a-z) to each number
.         expand 27
(32,015,256 observations created)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         tostring buchstabe, replace
buchstabe was float now str2
. 
. * recode the numeric values to letters
.         replace buchstabe="a" if buchstabe=="1"
(1,231,356 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,231,356 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,231,356 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,231,356 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,231,356 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,231,356 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,231,356 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,231,356 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,231,356 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,231,356 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,231,356 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,231,356 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,231,356 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,231,356 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,231,356 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,231,356 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,231,356 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,231,356 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,231,356 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,231,356 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,231,356 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,231,356 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,231,356 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,231,356 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,231,356 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,231,356 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(1,231,356 real changes made)
.         
. *save tempfile (appended below)
.         tempfile full_buchstabe 
.         save `full_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(hnr_orig_segment)
(3,836 observations deleted)

.         assert !missing(hnr_min)

.         assert !missing(hnr_max)

. 
.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case.x: address named exactly (border cases of the segments: if 6-10a -> 6 and 10a)
. * expand for first or second part
.         expand 2
(8,362 observations created)
. 
. * gen identifier for first and second part
.         bys stadtbez sb merge_strasse hnr_orig_segment: gen tmp1 = _n // 1 or 2
.         bys stadtbez sb merge_strasse hnr_orig_segment: assert tmp1<=2
.         
. * gen address number (numeric and letter part)
.         gen hnr = hnr_min if tmp1==1
(8,362 missing values generated)
.         replace hnr = hnr_max if tmp1==2
(8,362 real changes made)
.         gen buchstabe = "."
.         replace buchstabe = buchstaben_min if tmp1==1
(8,362 real changes made)
.         replace buchstabe = buchstaben_max if tmp1==2
(8,362 real changes made)
.         drop tmp1
. 
. * keep relevant variables
.         keep merge_strasse hnr buchstabe sb stadtbez
. 
. * drop duplicates if min and max are equal
.         bys merge_strasse hnr buchstabe sb stadtbez: keep if _n==1 
(694 observations deleted)
. 
. *save tempfile (appended below)
.         tempfile exact 
.         save `exact'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format
. }

. 
. 
. * destring 
.         destring hnr_min hnr_max, replace
hnr_min already numeric; no replace
hnr_max already numeric; no replace

.         assert hnr_min<=hnr_max

. 
. // split segments to the corresponding numbers (what is afterward still missing are potential le
> tters belonging to addresses)
. * tmp1: county number of distinct street numbers b/w hnr_min and hnr_max generate a variable con
> taining how many different numbers a segment contains
.         gen tmp1 = hnr_max - hnr_min + 1

. 
. * expand to number of distinct street numbers
.         expand tmp1
(160,562 observations created)

.         drop tmp1

. 
. * tmp3: generate the address number
.         bys stadtbez merge_strasse hnr_orig_segment: gen tmp3 = _n

.         replace tmp3 = tmp3 - 1 + hnr_min
(145,293 real changes made)

. 
. * segments contain only even/odd numbers. generated numbers that do not fit are removed 
.         drop if odd==1 & mod(tmp3, 2) == 0
(40,070 observations deleted)

.         drop if even==1 & mod(tmp3, 2) == 1
(40,211 observations deleted)

. 
. * drop
.         drop hnr_orig_segment

.         
. * rename address number variable 
.         rename tmp3 hnr

.         
.         
.         
. frame copy default tmp, replace

. frame tmp {
. *case1: beginning and ending of segment contain only numbers and no letters
.         keep if missing(buchstaben_min) & missing(buchstaben_max)
(8,062 observations deleted)
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(2,095,106 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="a" if buchstabe=="1"
(80,581 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(80,581 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(80,581 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(80,581 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(80,581 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(80,581 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(80,581 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(80,581 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(80,581 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(80,581 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(80,581 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(80,581 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(80,581 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(80,581 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(80,581 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(80,581 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(80,581 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(80,581 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(80,581 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(80,581 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(80,581 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(80,581 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(80,581 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(80,581 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(80,581 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(80,581 real changes made)
.         replace buchstabe="" if buchstabe=="27"
(80,581 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
. 
. *save tempfile (appended below)
.         tempfile no_buchstabe 
.         save `no_buchstabe'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with
.         drop if missing(buchstaben_min) & missing(buchstaben_max)
(80,581 observations deleted)

. 
. frame copy default tmp, replace

. frame tmp {
. *case 2: only beginning of the segment contains a letter (buchstaben_min)
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)
(6,130 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(574 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(306 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(150 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(35 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(55 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
variable tmp_buch was str1 now str2
(28 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(50,232 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment1: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(52,164 real changes made)
.         drop if buchstabe < tmp_buch & hnr==hnr_min
(250 observations deleted)
. 
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(1,764 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(1,886 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(1,913 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(1,925 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(1,928 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(1,931 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1,931 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(1,931 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(1,931 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(1,931 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(1,931 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(1,932 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(1,932 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(1,932 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(1,932 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(1,932 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(1,932 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(1,932 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(1,932 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(1,932 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(1,932 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(1,932 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(1,932 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(1,932 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(1,932 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(1,932 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(1,932 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch
.         
. *save tempfile (appended below)
.         tempfile buchstabe_min 
.         save `buchstabe_min'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case 3: only ending of the segment contains a letter (buchstaben_max)
.         keep if missing(buchstaben_min) & missing(buchstaben_max)==0
(2,119 observations deleted)
.         
. * generate numeric variable for the letter mentioned in the address (buchstaben_max)
.         gen tmp_buch = "1" if buchstaben_max=="a"
(2,241 missing values generated)
.         replace tmp_buch = "2" if buchstaben_max=="b"
(1,228 real changes made)
.         replace tmp_buch = "3" if buchstaben_max=="c"
(564 real changes made)
.         replace tmp_buch = "4" if buchstaben_max=="d"
(220 real changes made)
.         replace tmp_buch = "5" if buchstaben_max=="e"
(95 real changes made)
.         replace tmp_buch = "6" if buchstaben_max=="f"
(62 real changes made)
.         replace tmp_buch = "7" if buchstaben_max=="g"
(34 real changes made)
.         replace tmp_buch = "8" if buchstaben_max=="h"
(27 real changes made)
.         replace tmp_buch = "9" if buchstaben_max=="i"
(4 real changes made)
.         replace tmp_buch = "10" if buchstaben_max=="j"
variable tmp_buch was str1 now str2
(3 real changes made)
.         replace tmp_buch = "11" if buchstaben_max=="k"
(4 real changes made)
.         replace tmp_buch = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_max=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(154,518 observations created)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: assert(_N==27)
.         bys stadtbez merge_strasse hnr hnr_orig_segment2: gen buchstabe = _n
.         replace buchstabe = buchstabe-1
(160,461 real changes made)
.         drop if buchstabe > tmp_buch & hnr==hnr_max
(14,722 observations deleted)
.         
. * recode the numeric values to letters again
.         tostring buchstabe, replace
buchstabe was float now str2
.         replace buchstabe="" if buchstabe=="0"
(5,943 real changes made)
.         replace buchstabe="a" if buchstabe=="1"
(5,943 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(5,560 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(5,436 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5,387 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(5,361 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(5,350 real changes made)
.         replace buchstabe="g" if buchstabe=="7"
(5,345 real changes made)
.         replace buchstabe="h" if buchstabe=="8"
(5,342 real changes made)
.         replace buchstabe="i" if buchstabe=="9"
(5,340 real changes made)
.         replace buchstabe="j" if buchstabe=="10"
(5,339 real changes made)
.         replace buchstabe="k" if buchstabe=="11"
(5,338 real changes made)
.         replace buchstabe="l" if buchstabe=="12"
(5,337 real changes made)
.         replace buchstabe="m" if buchstabe=="13"
(5,337 real changes made)
.         replace buchstabe="n" if buchstabe=="14"
(5,337 real changes made)
.         replace buchstabe="o" if buchstabe=="15"
(5,337 real changes made)
.         replace buchstabe="p" if buchstabe=="16"
(5,337 real changes made)
.         replace buchstabe="q" if buchstabe=="17"
(5,337 real changes made)
.         replace buchstabe="r" if buchstabe=="18"
(5,337 real changes made)
.         replace buchstabe="s" if buchstabe=="19"
(5,337 real changes made)
.         replace buchstabe="t" if buchstabe=="20"
(5,337 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(5,337 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(5,337 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(5,337 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(5,337 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(5,337 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(5,337 real changes made)
.         
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch 
.         
. *save tempfile (appended below)
.         tempfile buchstabe_max 
.         save `buchstabe_max'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
. }

. 
. 
. * drop cases dealt with so far
.         keep if missing(buchstaben_min)==0 & missing(buchstaben_max)==0
(7,875 observations deleted)

.         
. 
. frame copy default tmp, replace

. frame tmp {
. *case4: assinment given for exactly one address (same street and same letter)
.         keep if hnr_min==hnr_max & buchstaben_min==buchstaben_max
(177 observations deleted)
.         gen buchstabe = buchstaben_min
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 
.         
. *save tempfile (appended below)
.         tempfile one_address 
.         save `one_address'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
. }

. 
. 
. frame copy default tmp, replace

. frame tmp {
. *case5: assignment given for exactly one street number (but with different addresses (letters))
.         keep if hnr_min==hnr_max & buchstaben_min!=buchstaben_max
(178 observations deleted)
. 
. * generate numeric variable for the first letter mentioned in the address (buchstaben_min)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(2 missing values generated)
.         replace tmp_buch = "2" if buchstaben_min=="b"
(2 real changes made)
.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)
.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)
.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)
.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)
.         replace tmp_buch = "7" if buchstaben_min=="g"
(0 real changes made)
.         replace tmp_buch = "8" if buchstaben_min=="h"
(0 real changes made)
.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)
.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)
.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)
.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)
.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)
.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)
.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)
.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)
.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)
.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)
.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)
.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)
.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)
.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)
.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)
.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)
.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)
.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)
.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte
. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(9 missing values generated)
.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(2 real changes made)
.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(2 real changes made)
.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(3 real changes made)
.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(1 real change made)
.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)
.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)
.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)
.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)
.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)
.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)
.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)
.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)
.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)
.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)
.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)
.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)
.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)
.         replace tmp_buch2 = "19" if buchstaben_max=="s"
variable tmp_buch2 was str1 now str2
(1 real change made)
.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)
.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)
.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)
.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)
.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)
.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)
.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)
.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte
. 
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 26
(225 observations created)
.         bys stadtbez merge_strasse hnr: assert(_N==26)
.         bys stadtbez merge_strasse hnr: gen buchstabe = _n
.         drop if buchstabe < tmp_buch
(2 observations deleted)
.         drop if buchstabe > tmp_buch2
(188 observations deleted)
.         tostring buchstabe, replace
buchstabe was float now str2
.         
. * recode the numeric values to letters again
.         replace buchstabe="a" if buchstabe=="1"
(7 real changes made)
.         replace buchstabe="b" if buchstabe=="2"
(9 real changes made)
.         replace buchstabe="c" if buchstabe=="3"
(7 real changes made)
.         replace buchstabe="d" if buchstabe=="4"
(5 real changes made)
.         replace buchstabe="e" if buchstabe=="5"
(2 real changes made)
.         replace buchstabe="f" if buchstabe=="6"
(1 real change made)
.         replace buchstabe="g" if buchstabe=="7"
(1 real change made)
.         replace buchstabe="h" if buchstabe=="8"
(1 real change made)
.         replace buchstabe="i" if buchstabe=="9"
(1 real change made)
.         replace buchstabe="j" if buchstabe=="10"
(1 real change made)
.         replace buchstabe="k" if buchstabe=="11"
(1 real change made)
.         replace buchstabe="l" if buchstabe=="12"
(1 real change made)
.         replace buchstabe="m" if buchstabe=="13"
(1 real change made)
.         replace buchstabe="n" if buchstabe=="14"
(1 real change made)
.         replace buchstabe="o" if buchstabe=="15"
(1 real change made)
.         replace buchstabe="p" if buchstabe=="16"
(1 real change made)
.         replace buchstabe="q" if buchstabe=="17"
(1 real change made)
.         replace buchstabe="r" if buchstabe=="18"
(1 real change made)
.         replace buchstabe="s" if buchstabe=="19"
(1 real change made)
.         replace buchstabe="t" if buchstabe=="20"
(0 real changes made)
.         replace buchstabe="u" if buchstabe=="21"
(0 real changes made)
.         replace buchstabe="v" if buchstabe=="22"
(0 real changes made)
.         replace buchstabe="w" if buchstabe=="23"
(0 real changes made)
.         replace buchstabe="x" if buchstabe=="24"
(0 real changes made)
.         replace buchstabe="y" if buchstabe=="25"
(0 real changes made)
.         replace buchstabe="z" if buchstabe=="26"
(0 real changes made)
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2
.         
. *save tempfile (appended below)
.         tempfile one_number 
.         save `one_number'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
. }

. 
. * drop cases dealt with so far
.         drop if hnr_min==hnr_max
(19 observations deleted)

. 
. 
. *last remaining case (case6): first and second mentioned address contain letter and both have di
> fferent numbers (e.g., 8b-11d)
.         * generate numeric variable for the first letter mentioned in the address (buchstaben_mi
> n)
.         gen tmp_buch = "1" if buchstaben_min=="a"
(16 missing values generated)

.         replace tmp_buch = "2" if buchstaben_min=="b"
(2 real changes made)

.         replace tmp_buch = "3" if buchstaben_min=="c"
(0 real changes made)

.         replace tmp_buch = "4" if buchstaben_min=="d"
(0 real changes made)

.         replace tmp_buch = "5" if buchstaben_min=="e"
(0 real changes made)

.         replace tmp_buch = "6" if buchstaben_min=="f"
(0 real changes made)

.         replace tmp_buch = "7" if buchstaben_min=="g"
(6 real changes made)

.         replace tmp_buch = "8" if buchstaben_min=="h"
(8 real changes made)

.         replace tmp_buch = "9" if buchstaben_min=="i"
(0 real changes made)

.         replace tmp_buch = "10" if buchstaben_min=="j"
(0 real changes made)

.         replace tmp_buch = "11" if buchstaben_min=="k"
(0 real changes made)

.         replace tmp_buch = "12" if buchstaben_min=="l"
(0 real changes made)

.         replace tmp_buch = "13" if buchstaben_min=="m"
(0 real changes made)

.         replace tmp_buch = "14" if buchstaben_min=="n"
(0 real changes made)

.         replace tmp_buch = "15" if buchstaben_min=="o"
(0 real changes made)

.         replace tmp_buch = "16" if buchstaben_min=="p"
(0 real changes made)

.         replace tmp_buch = "17" if buchstaben_min=="q"
(0 real changes made)

.         replace tmp_buch = "18" if buchstaben_min=="r"
(0 real changes made)

.         replace tmp_buch = "19" if buchstaben_min=="s"
(0 real changes made)

.         replace tmp_buch = "20" if buchstaben_min=="t"
(0 real changes made)

.         replace tmp_buch = "21" if buchstaben_min=="u"
(0 real changes made)

.         replace tmp_buch = "22" if buchstaben_min=="v"
(0 real changes made)

.         replace tmp_buch = "23" if buchstaben_min=="w"
(0 real changes made)

.         replace tmp_buch = "24" if buchstaben_min=="x"
(0 real changes made)

.         replace tmp_buch = "25" if buchstaben_min=="y"
(0 real changes made)

.         replace tmp_buch = "26" if buchstaben_min=="z"
(0 real changes made)

.         destring tmp_buch, replace
tmp_buch: all characters numeric; replaced as byte

. 
. * generate numeric variable for the second letter mentioned in the address (buchstaben_max)
.         gen tmp_buch2 = "1" if buchstaben_max=="a"
(68 missing values generated)

.         replace tmp_buch2 = "2" if buchstaben_max=="b"
(32 real changes made)

.         replace tmp_buch2 = "3" if buchstaben_max=="c"
(11 real changes made)

.         replace tmp_buch2 = "4" if buchstaben_max=="d"
(25 real changes made)

.         replace tmp_buch2 = "5" if buchstaben_max=="e"
(0 real changes made)

.         replace tmp_buch2 = "6" if buchstaben_max=="f"
(0 real changes made)

.         replace tmp_buch2 = "7" if buchstaben_max=="g"
(0 real changes made)

.         replace tmp_buch2 = "8" if buchstaben_max=="h"
(0 real changes made)

.         replace tmp_buch2 = "9" if buchstaben_max=="i"
(0 real changes made)

.         replace tmp_buch2 = "10" if buchstaben_max=="j"
(0 real changes made)

.         replace tmp_buch2 = "11" if buchstaben_max=="k"
(0 real changes made)

.         replace tmp_buch2 = "12" if buchstaben_max=="l"
(0 real changes made)

.         replace tmp_buch2 = "13" if buchstaben_max=="m"
(0 real changes made)

.         replace tmp_buch2 = "14" if buchstaben_max=="n"
(0 real changes made)

.         replace tmp_buch2 = "15" if buchstaben_max=="o"
(0 real changes made)

.         replace tmp_buch2 = "16" if buchstaben_max=="p"
(0 real changes made)

.         replace tmp_buch2 = "17" if buchstaben_max=="q"
(0 real changes made)

.         replace tmp_buch2 = "18" if buchstaben_max=="r"
(0 real changes made)

.         replace tmp_buch2 = "19" if buchstaben_max=="s"
(0 real changes made)

.         replace tmp_buch2 = "20" if buchstaben_max=="t"
(0 real changes made)

.         replace tmp_buch2 = "21" if buchstaben_max=="u"
(0 real changes made)

.         replace tmp_buch2 = "22" if buchstaben_max=="v"
(0 real changes made)

.         replace tmp_buch2 = "23" if buchstaben_max=="w"
(0 real changes made)

.         replace tmp_buch2 = "24" if buchstaben_max=="x"
(0 real changes made)

.         replace tmp_buch2 = "25" if buchstaben_max=="y"
(0 real changes made)

.         replace tmp_buch2 = "26" if buchstaben_max=="z"
(0 real changes made)

.         destring tmp_buch2, replace
tmp_buch2: all characters numeric; replaced as byte

.         
. * generate duplicates for each letter but drop duplicates again if they are before the mentioned
>  letter
.         expand 27
(4,368 observations created)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: assert(_N==27)

.         bys stadtbez merge_strasse hnr hnr_orig_segment1 hnr_orig_segment2: gen buchstabe = _n

.         replace buchstabe = buchstabe-1
(4,536 real changes made)

.         drop if buchstabe < tmp_buch & hnr_min==hnr
(27 observations deleted)

.         drop if buchstabe > tmp_buch2 & hnr_max==hnr
(317 observations deleted)

.         tostring buchstabe, replace
buchstabe was float now str2

.         
. * recode the numeric values to letters again
.         replace buchstabe="" if buchstabe=="0"
(155 real changes made)

.         replace buchstabe="a" if buchstabe=="1"
(165 real changes made)

.         replace buchstabe="b" if buchstabe=="2"
(157 real changes made)

.         replace buchstabe="c" if buchstabe=="3"
(156 real changes made)

.         replace buchstabe="d" if buchstabe=="4"
(154 real changes made)

.         replace buchstabe="e" if buchstabe=="5"
(153 real changes made)

.         replace buchstabe="f" if buchstabe=="6"
(153 real changes made)

.         replace buchstabe="g" if buchstabe=="7"
(154 real changes made)

.         replace buchstabe="h" if buchstabe=="8"
(155 real changes made)

.         replace buchstabe="i" if buchstabe=="9"
(155 real changes made)

.         replace buchstabe="j" if buchstabe=="10"
(155 real changes made)

.         replace buchstabe="k" if buchstabe=="11"
(155 real changes made)

.         replace buchstabe="l" if buchstabe=="12"
(155 real changes made)

.         replace buchstabe="m" if buchstabe=="13"
(155 real changes made)

.         replace buchstabe="n" if buchstabe=="14"
(155 real changes made)

.         replace buchstabe="o" if buchstabe=="15"
(155 real changes made)

.         replace buchstabe="p" if buchstabe=="16"
(155 real changes made)

.         replace buchstabe="q" if buchstabe=="17"
(155 real changes made)

.         replace buchstabe="r" if buchstabe=="18"
(155 real changes made)

.         replace buchstabe="s" if buchstabe=="19"
(155 real changes made)

.         replace buchstabe="t" if buchstabe=="20"
(155 real changes made)

.         replace buchstabe="u" if buchstabe=="21"
(155 real changes made)

.         replace buchstabe="v" if buchstabe=="22"
(155 real changes made)

.         replace buchstabe="w" if buchstabe=="23"
(155 real changes made)

.         replace buchstabe="x" if buchstabe=="24"
(155 real changes made)

.         replace buchstabe="y" if buchstabe=="25"
(155 real changes made)

.         replace buchstabe="z" if buchstabe=="26"
(155 real changes made)

. 
. 
. 
. * keep only relevant variables
.         drop even odd hnr_min hnr_max  buchstaben_min buchstaben_max hnr_orig_segment1 hnr_orig_
> segment2 tmp_buch tmp_buch2

. 
.    
. *append all datasets created before   
.         append using `full_buchstabe'

.         append using `no_buchstabe'

.         append using `buchstabe_min'

.         append using `buchstabe_max'

.         append using `one_address'

.         append using `one_number'

. 
. *merge exact case (e.g., 4a in ab4a or 6a and 8b in 6a-8b) and drop merged addresses
. *they might occur a second time with a different precinct due to partly imprecise electoral roll
> s 
.         merge m:1 stadtbez sb merge_strasse hnr buchstabe using `exact', assert(1 3) keep(1) nog
> en

    Result                      Number of obs
    -----------------------------------------
    Not matched                    35,608,168
        from master                35,608,168  
        from using                          0  

    Matched                                 0  
    -----------------------------------------

. *append these exact cases where the correct precinct is known for sure
.         append using `exact'    

. 
. *generate addresse number (number and letter)
.         tostring hnr, replace 
hnr was float now str3

.         gen nummer = hnr + buchstabe

.         lab var nummer "address number"

. 
.         * destring precinct and district ID
.         replace sb = substr(sb, strlen(sb)-1, 2)
(35,624,198 real changes made)

.         replace sb = stadtbez + sb
(35,624,198 real changes made)

.         destring stadtbez sb, replace
stadtbez: all characters numeric; replaced as byte
sb: all characters numeric; replaced as int

.         *tostring stadtbez sb, replace
. 
. * Handle duplicate addresses:
.         * 1) duplicates within district across precincts: drop BOTH b/c definitive assignment to
>  precinct not possible
.         * 2) duplicates within precinct (sb): keep one copy
.         duplicates drop stadtbez merge_strasse nummer sb, force

Duplicates in terms of stadtbez merge_strasse nummer sb

(0 observations are duplicates)

.         bys stadtbez merge_strasse nummer: keep if _N==1
(7,044 observations deleted)

. 
. * keep only necessary variables
.         keep merge_strasse nummer sb stadtbez

. 
. *save
.         save "$tmp/strassen_kow20_voll_buchstabe.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_kow20_voll_buchsta
    > be.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/strassen_kow20_voll_buchsta
    > be.dta saved

. 
end of do-file
Running: 03_geocode_ltw18.do

. /*
> Input: tmp/strassen_prep_ltw18_single [list of all addresses]
> 
> Output: tmp/voter_addresses_unique_geocoded.dta [addresses with added geocodes]
> 
> Main task:
>         > merge geocodes from preprocessed geocoding (default)
> 
>         OR (in case you run the geocoding yourself)
> 
>         > prepare addresses for geocoding
>         > geocoding
>         > cleaning
> 
> Note: 
>         > We use the module 'opencagegeo' geo-reference addresses. The programm uses openstreetm
> ap (OSM).
>         
>                 >> Installation:
>                 * Install the Stata module and two required user-written stata libraries from SS
> C:
>                         . ssc install opencagegeo
>                         . ssc install libjson
>                         . ssc install insheetjson
>                 >> Batch geocode addresses (forward geocoding):
>                 opencagegeo , key(XXXXXX) countrycode(de) language(de) ///
>                                 city(stadt) street(strasse) number(nummer)
>                                 
>                 > Registration for API key is required
>                 > basic key allows for only 2,500 addresses per day and 1 request/sec 
>                         (we purchased a temporary key allowing for more addresses per day and al
> so 25-40 requests/sec )
>                 > 'opencagegeo' needs the following inputs (in addition to your API key): 
>                         countrycode(de): as Munich is in Germany
>                         language(de): street names are in Germany
>                         city(stadt): variable for the city (was generated by us)
>                         street(strasse): street name, coming from electoral roll
>                         number(nummer): address number, potentially containing letters (6, 6a, 6
> b, etc.)
>                         
>                 >> Resulting output:
>                         > generated variables have prefix "g_"
>                                 g_quality gives how detailed the address was found: city-, postc
> ode-, street-, number-level (number most exact; g_quality==7)
>                                 g_lon: longitude of address
>                                 g_lat: latitude of address
>                         > addresses not geocode at number-level are inspected manually. Often an
>  address exists but was not added to OSM
>                         > Haimhauserstrasse 13 was at a wrong location (corrected manually)
>                         > addresses geolocated outside of Munich were also inspected manually an
> d if not found in Munich dropped
>                         
>         If you want re-run the geocoding yourself set the global RERUN_GEOCODE_VOTER to 1 
>         and set your local API key in the _master.do.
>         
>         Otherwise, this dofile simply merges preprocessed geo-coordinates located in
>                 03_geocoded_addresses/ voter_addresses_ltw18_geocoded.dta
>         to the list of unique voter addresses.
> 
> */
. 
.  
. * PULL addresses from 2018
.         use "$tmp/strassen_prep_ltw18_single", clear 

. 
.  if $RERUN_GEOCODE_VOTER ==0 {
.         
.         //variables only needed for geocoding
.         drop strasse stadt
.         
.         // MERGE geocodes to voter addresses 
.         merge 1:1 stadtbez merge_strasse nummer using "$geocod/voter_addresses_ltw18_geocoded.dt
> a", assert(1 3) keep(3) nogen //some addresses not possible to geocode
(variable merge_strasse was str35, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           153,938  
    -----------------------------------------
.         
.         lab var g_lat "latitude of voter address"
.         lab var g_lon "longitude of voter address"
.         
.         // save
.         save "$tmp/voter_addresses_unique_geocoded.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_addresses_unique_geoc
    > oded.dta not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_addresses_unique_geoc
    > oded.dta saved
.  }

.  else if $RERUN_GEOCODE_VOTER ==1 {
. 
. ** 1. Prep 
.         // clean (some addresses contain a city)
.         split strasse, p("(")
.         replace stadt = strasse2 if missing(strasse2)==0
.         drop strasse1 strasse2
.         replace stadt = substr(stadt,1,strlen(stadt)-1) if substr(stadt,strlen(stadt),1)==")"
.         replace stadt="Pullach" if stadt=="Pul"
. 
.         sort stadtbez strasse nummer
. 
.         // KEEP only necessary variables (for geocoding or merging afterwards)
.         keep  stadt stadtbez merge_strasse strasse nummer
.         order stadt stadtbez merge_strasse strasse nummer
. 
. ** 2. Run geocoding using OPENCAGE
.         opencagegeo , key($api_key) countrycode(de) language(de) ///
>                                 city(stadt) street(strasse) number(nummer) 
. 
.         lab var g_lat "latitude of voter address"
.         lab var g_lon "longitude of voter address"
. 
.         // save raw results 
.         save "$tmp/voter_ltw18_einzel_geo_raw", replace
. 
. ** 3. Assess quality of result and manually correct errors
.         // manually correct coordinates 
.         // -->  g_quality==4 (city)
.         replace g_lat = "48.0663858" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="1
> "
.         replace g_lon = "11.5172119" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="1
> "
.         replace g_quality = 7            if merge_strasse=="wolfratshauserstrasse(pul)" & nummer
> =="1"
.         replace g_lat = "48.0662568" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="3
> "
.         replace g_lon = "11.5172146" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="3
> "
.         replace g_quality = 7            if merge_strasse=="wolfratshauserstrasse(pul)" & nummer
> =="3"
.         replace g_lat = "48.0660954" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="5
> "
.         replace g_lon = "11.5171395" if merge_strasse=="wolfratshauserstrasse(pul)" & nummer=="5
> "
.         replace g_quality = 7            if merge_strasse=="wolfratshauserstrasse(pul)" & nummer
> =="5"
.         replace g_lat = "48.1848956" if merge_strasse=="weimarerstrasse" & nummer=="30"
.         replace g_lon = "11.5900233" if merge_strasse=="weimarerstrasse" & nummer=="30"
.         replace g_quality = 7            if merge_strasse=="weimarerstrasse" & nummer=="30"
. 
.         // ---> g_quality==5 (postcode)
.         replace g_lat = "48.1369886" if merge_strasse=="hofstatt" & nummer=="4"
.         replace g_lon = "11.5712595" if merge_strasse=="hofstatt" & nummer=="4"
.         replace g_quality = 7            if merge_strasse=="hofstatt" & nummer=="4"
.         replace g_lat = "48.1347055" if merge_strasse=="ammoosfeld" & nummer=="15b"
.         replace g_lon = "11.6585821" if merge_strasse=="ammoosfeld" & nummer=="15b"
.         replace g_quality = 7            if merge_strasse=="ammoosfeld" & nummer=="15b"
. 
.         // check quality 
.         tab g_quality
.         // DROP addresses that could not be geocoded
.         drop if g_quality<7
.         
.         // KEEP only addresses in Munich
.         keep if g_city=="München"
. 
.         // CORRECT mis-geolocated address (wrong location in OSM)
.         replace g_lat = "48.1623233" if merge_strasse=="haimhauserstrasse" & nummer=="13"
.         replace g_lon = "11.5901594" if merge_strasse=="haimhauserstrasse" & nummer=="13"
. 
.         // ASSERT uniqueness
.         isid stadtbez merge_strasse nummer
.         
.         // KEEP only relevant variables
.         keep stadtbez merge_strasse nummer g_lat g_lon
. 
.         // save: CLEANED geocoding
.         save "$tmp/voter_addresses_unique_geocoded.dta", replace
.         
. }

. 
end of do-file
Running: 04_voter_panel.do

. /*
> 
> Inputs:
>         > tmp/voter_addresses_unique_geocoded.dta [full address file from the 2018 with geocodes
> ]
>         > tmp/strassen_`election'_voll_buchstabe [address - precinct assignments for each electi
> on]
> 
> Output: tmp/voter_id_panel_raw.dta
>                 [balanced panel of voter-addresses and mapping to precinct (but no polling locat
> ion yet)]
> 
> Main task:
>         > merge address geocoordinates from 2018 geolocation
>         > identify voter addresses that appear in ALL elections
>         > gen voter_id:= string ID of voter address 
>         > save election-sepecific files 
>         > append all elections
> 
> */
.         
. *** 1) Create list of addresses that appear in EVERY election
. * PULL: geocoded addresses based on 2018 electoral roll 
. use "$tmp/voter_addresses_unique_geocoded.dta", clear // 153,938 addresses

. 
. * Merge addresses from other elecection and KEEP only addresses that appear in ALL Elections (ba
> lanced panel)
.         foreach election in "btw17" "ltw18" "euw19" "kow20" "kow14" "ltw13" "btw09" {
  2.                 merge 1:1 stadtbez merge_strasse nummer using "$tmp/strassen_`election'_voll_
> buchstabe", keep(3) nogen keepusing(stadtbez merge_strasse nummer)
  3.         }

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           153,201  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           153,013  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           152,985  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           152,788  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           151,930  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           151,812  
    -----------------------------------------

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------

. 
. 
. *rename and destring
.         ren     g_lat lat_vote

.         lab var lat_vote "latitude of voters address"

.         ren     g_lon lon_vote

.         lab var lon_vote "longitude of voters address"

.         destring  lat_vote lon_vote, replace
lat_vote: all characters numeric; replaced as double
lon_vote: all characters numeric; replaced as double

.         
. * Gen Voter-ID                                                                                  
>                         
.         gen     voter_id_str    = merge_strasse + nummer

.         lab var voter_id_str "ID for addresses of eligible voters"

. 
. *save
.         isid voter_id_str

.         tempfile voter_merged_all_geo_final

.         save `voter_merged_all_geo_final'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format

. 
. *** 2) Use address-precinct mappings; KEEP balanced addresses and merge geocodes to addresses
. foreach election in "btw09" "ltw13" "kow14" "btw17" "ltw18" "euw19" "kow20" {
  2.         
.         * PULL: assignment of voter-addresses to precincts
.         use "$tmp/strassen_`election'_voll_buchstabe", clear
  3.         gen wahl = upper("`election'")
  4.         
.         // DROP addresses that are not in EVERY election + merge geocodes
.         merge 1:1 stadtbez merge_strasse nummer using `voter_merged_all_geo_final', nogen keep(3
> ) assert(1 3)
  5.         
.         keep stadtbez voter_id_str lat_vote lon_vote sb wahl
  6.         order voter_id_str stadtbez sb lon_vote lat_vote
  7.         
.         label var sb "precint (first two digits for the city district)"
  8.         label var stadtbez "city district (1-25)"
  9.         isid voter_id_str
 10.         
.         tempfile strassen_`election'_geo
 11.         save `strassen_`election'_geo'
 12. }

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format
(variable merge_strasse was str35, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format
(variable merge_strasse was str38, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format
(variable merge_strasse was str38, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format
(variable merge_strasse was str38, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format
(variable merge_strasse was str38, now str39 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                           150,779  
    -----------------------------------------
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000008.tmp saved as .dta format

. 
. 
. *** 3) append into BALANCED panel at voter-address x election
. clear 

. local j=0

. gen wahl_id = .

.  /*note: ltw13 and kow14 are duplicates b/c btw13 and euw14 had NO CHANGES to assignments */
. foreach election in "btw09" "ltw13" "ltw13" "kow14" "kow14" "btw17" "ltw18" "euw19" "kow20" {  
  2.         append using `strassen_`election'_geo'
  3.         replace wahl_id = `j' if missing(wahl_id)
  4.         replace wahl = "BTW13" if wahl_id==2
  5.         replace wahl = "EUW14" if wahl_id==4
  6.         local ++j
  7. }
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(150,779 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(150,779 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)
(150,779 real changes made)
(0 real changes made)
(0 real changes made)

. 
.  // gen numeric voter_id 
.         egen    voter_id=group(voter_id_str)

.         lab var voter_id "Numerical voter-address ID"

. 
.  // label election ID (in chronological order)
.         lab def wahl_id 0 "BTW09" 1 "LTW13" 2 "BTW13" 3 "KOW14" 4 "EUW14" 5 "BTW17" 6 "LTW18" 7 
> "EUW19" 8 "KOW20"

.         lab val wahl_id wahl_id

.         lab var wahl_id "Election ID (num, chronological)"

.         lab var wahl    "Election ID (string)"

. 
.         lab var sb               "Precinct ID (Stimmbezirk)"

.         lab var stadtbez "District ID (Stadtbezirk)"

. 
. 
.  // SAVE: balanced panel of addresses x election (no polling locations yet)
.         isid voter_id wahl_id

.         save "$tmp/voter_id_panel_raw.dta", replace
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_id_panel_raw.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_id_panel_raw.dta
    saved

. 
.         
. 
end of do-file
Running: 05_prep_polling_stations.do

. 
. /*
> 
> Input: electoral rolls (for the federal election 2009) and polling place files (all other electi
> ons)
>         > BTW2009-Strvz-num.csv                                         [federal 2009]
>         > BTW_2013_Wahllokalverzeichnis.xlsx            [federal 2013]
>         > KommW_2014_Wahllokalverzeichnis.xlsx          [municipal 2014]
>         > BTW_2017_Wahllokalverzeichnis.xlsx            [federal 2017]
>         > LTW_2018_Wahllokalverzeichnis.xlsx            [state 2018]
>         > EuW_2019_Wahllokalverzeichnis.xlsx            [european 2019]
>         > KommW_2020_Wahllokalverzeichnis.xlsx          [municipal 2020]
> 
> Output: 
>         > tmp/wl_unique.dta [list for geocoding of polling locations]
>         > tmp/wl_sb_assignments_raw.dta [assignment of precincts and polling locations for each 
> election]
> 
> Tasks:
>         >Import adresses of polling locations for all election years
>         >Prepare them for geocoding
>         >Merge them (and save a list of unique locations)
>         >Append all elections to have assignment of precincts and polling locations
>         
> */
. 
. /* programm to clean street names */
. cap program drop clean_streetname

. program clean_streetname 
  1. 
. syntax varname(string)
  2. 
.         // general clean
.         replace `varlist' = subinstr(`varlist', "EG", "", .)     
  3.         replace `varlist' = subinstr(`varlist', "1.OG", "", .)
  4.         replace `varlist' = subinstr(`varlist',"St.","Sankt",.)
  5.         replace `varlist' = subinstr(`varlist',"Südl.","Südliche",.)
  6.         replace `varlist' = subinstr(`varlist',"Alle","Allee",.)
  7.         replace `varlist' = subinstr(`varlist',"Alleee","Allee",.)      
  8.         replace `varlist' = subinstr(`varlist',"pl.","platz",.)
  9.         replace `varlist' = subinstr(`varlist',"Pl.","Platz",.)         
 10.         replace `varlist' = ustrregexra(`varlist',"[sS]tra(ss|ß)e","strasse")
 11.         replace `varlist' = ustrregexra(`varlist',"[sS]tr\.","strasse")
 12.         
.         // BTW13
.         replace `varlist' = subinstr(`varlist',"Benningsenstrasse","Bennigsenstrasse",.)
 13.         replace `varlist' = subinstr(`varlist',"Max-Kolmsberger-strasse","Max-Kolmsperger-str
> asse",.)
 14.         replace `varlist' = subinstr(`varlist',"Agilofingerplatz","Agilolfingerplatz",.)
 15.         replace `varlist' = subinstr(`varlist',"Freseniussstrasse","Freseniusstrasse",.)
 16.         replace `varlist' = subinstr(`varlist',"Max-Pröbstl-strasse","Max-Proebstl-strasse",.
> )
 17.                 
.         // BTW17
.         replace `varlist' = subinstr(`varlist',"Hiltenpergerstrasse","Hiltenspergerstrasse",.)
 18.         replace `varlist' = subinstr(`varlist',"Rosa-Bavaresa-strasse","Rosa-Bavarese-strasse
> ",.)
 19.         replace `varlist' = subinstr(`varlist',"Max-Proepstl-strasse","Max-Proebstl-strasse",
> .)
 20.         replace `varlist' = subinstr(`varlist',"Von-der-Pforden-strasse","Von-der-Pfordten-st
> rasse",.)
 21.         
.         // KOW20 
.         replace `varlist' = subinstr(`varlist',"Petracastrasse","Petrarcastrasse",.)
 22.         replace `varlist' = subinstr(`varlist',"Alb.","Albert",.)
 23.         replace `varlist' = subinstr(`varlist',"Hildegard-Hamm-Brücher","Hildegard-Hamm-Brüch
> er-strasse",.)
 24.         
.         replace `varlist' = "Untermenzingerstrasse" if `varlist'=="UntermenzingerStrasse"
 25.         
. end

. 
. /* programm to harmonize street names to create unique PP ID */
. cap program drop harmon_street

. program harmon_street 
  1. 
. syntax varname(string)
  2. 
.         replace `varlist' = subinstr(`varlist',"Dr.","Doktor",.)
  3.         replace `varlist' = subinstr(`varlist',"Prof.","Professor",.)
  4.         replace `varlist' = subinstr(`varlist'," ","",.)
  5.         replace `varlist' = lower(`varlist')
  6.         replace `varlist' = subinstr(`varlist',"-","",.)
  7.         replace `varlist' = subinstr(`varlist',".","",.)
  8.         replace `varlist' = subinstr(`varlist',"'","",.)
  9.         replace `varlist' = subinstr(`varlist',"ß","ss",.)
 10.         replace `varlist' = subinstr(`varlist',"ä","ae",.)
 11.         replace `varlist' = subinstr(`varlist',"ö","oe",.)
 12.         replace `varlist' = subinstr(`varlist',"ü","ue",.)
 13. 
. end

. 
. /* 1. Import and prep*/
. 
. tempfile wl_btw09 wl_btw13 wl_kow14 wl_btw17 wl_ltw18 wl_euw19 wl_kow20

. tempfile wl_btw09_uq wl_btw13_uq wl_kow14_uq wl_btw17_uq wl_ltw18_uq wl_euw19_uq wl_kow20_uq

. 
. *--------------------*
. **** Import BTW09 ****
. *--------------------*
. * Note: 2009 different from other elections as polling places come from the electoral rolls
. import delim using "$rawdata/election_office/electoral_rolls/BTW2009-Strvz-num.csv", ///
>         encoding("utf-8") clear colrange(1:7) delim(";")
(7 vars, 65,536 obs)

. drop v2 v4 v6

. 
. * keep only rows with relevant information
.         missings dropobs, force

Checking missings in v1 v3 v5 v7:
59216 observations with missing values

(59,215 observations deleted)

. 
. * sever columns and append below each other
.         forvalues j=1(2)7 {
  2.                 preserve
  3.                         keep v`j'
  4.                         rename v`j' v1
  5.                         tempfile strassen_btw09_v`j'
  6.                         save     `strassen_btw09_v`j''
  7.                 restore
  8.         }
  (all newnames==oldnames)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000g.tmp saved as .dta format
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000i.tmp saved as .dta format
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000k.tmp saved as .dta format
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000m.tmp saved as .dta format

.  clear 

.          // append
.          forvalues j=1(2)7 {
  2.                 append using `strassen_btw09_v`j''
  3.          }

. 
. // gen variables for city district (stadtbez) and precint (sb)
.         gen stadtbez = subinstr(v1,"S t a d t b e z i r k","",.) if substr(v1, 1, 21)=="S t a d 
> t b e z i r k"
(25,259 missing values generated)

.         destring stadtbez, replace
stadtbez: all characters numeric; replaced as byte
(25259 missing values generated)

.         distinct stadtbez 

          |        Observations
          |      total   distinct
----------+----------------------
 stadtbez |         25         25

.         assert r(ndistinct)==25 // assert 25 districts

.         
.         gen sb_all = subinstr(v1,"W a h l b e z i r k","",.) if substr(v1, 1, 19)=="W a h l b e 
> z i r k"
(24,620 missing values generated)

. 
. // identify and extract polling place address
. /*
> Note: Entries for Polling places follow this structure:
>         
>         ---blank row ---
>         Wahlraum:                                       // Always preceded by "Wahlraum" ("votin
> g room")
>         Schule                                          // Type of Polling place (1 or 2 lines)
>         Südliche Auffahrtsallee 82 // Polling place address
>         ---blank row ---
> 
> */
.         gen tmp_strasse = subinstr(v1, " ", "", .)
(4,697 missing values generated)

.         // gen dummy that identifies start of Polling place entry
.         gen isWL = ustrregexm(tmp_strasse,"\bWahlraum\b")

.         // expand dummy to fill total entry based on -blanks- in tmp_strasse
.         replace isWL = isWL[_n-1] if !missing(tmp_strasse[_n-1]) &  !missing(tmp_strasse[_n]) 
(1,361 real changes made)

.         // extract PP address (=last row of each entry)
.         gen     wahllokal= v1 if isWL==1 & missing(tmp_strasse[_n+1])
(24,620 missing values generated)

.         lab var wahllokal "Raw PP address"

.         cap drop tmp*   

.         
.  // extract wahllokal_type 
.         gen wahllokal_type = ""
(25,284 missing values generated)

.         replace wahllokal_type = v1 if isWL==1 & strpos(v1,"Wahlraum")==0 & wahllokal==""
variable wahllokal_type was str1 now str33
(697 real changes made)

.         replace wahllokal_type = wahllokal_type[_n-1]+wahllokal_type[_n] if !missing(wahllokal_t
> ype[_n])
variable wahllokal_type was str33 now str95
(33 real changes made)

.         replace wahllokal_type = "" if wahllokal_type[_n-1]=="" & wahllokal_type[_n+1]!=""
(33 real changes made)

.         replace wahllokal_type = stritrim(wahllokal_type)
(31 real changes made)

.         replace wahllokal_type = strtrim(wahllokal_type)
(664 real changes made)

.         replace wahllokal_type=wahllokal_type[_n-1] if wahllokal!=""
(664 real changes made)

.         lab var wahllokal_type "Raw PP description"

.         drop isWL

.         
. // expand district and precinct IDs
.         replace stadtbez = stadtbez[_n-1] if missing(stadtbez)
(25,259 real changes made)

.         replace sb_all = sb_all[_n-1] if missing(sb_all)
(24,618 real changes made)

.         replace sb_all = strtrim(sb_all)
(25,282 real changes made)

.         lab var sb_all "(List of) Precinct ID(s)"

. 
. // keep unique combinations of precinct and polling place 
.         keep if !missing(wahllokal)
(24,620 observations deleted)

.         keep sb_all wahllokal wahllokal_type

.         
. ** Clean PP address; (remove spaces and unnecessary information (e.g., floor))
.         replace wahllokal = subinstr(wahllokal, " ", "", .)
(664 real changes made)

.         clean_streetname wahllokal
(89 real changes made)
(35 real changes made)
(4 real changes made)
(0 real changes made)
(5 real changes made)
(5 real changes made)
(42 real changes made)
(21 real changes made)
(0 real changes made)
(547 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
.         // extract street name of PP
.         gen     strasse_wl = ustrregexs(1) if ustrregexm(wahllokal,"([^0-9]+)[\.]?([\w-]+)")

.         lab var strasse_wl "PP street name cleaned for geocoding"

.         // extract address number (including cases e.g., 1-4 and 5a)
.         gen     nummer_wl =  ustrregexs(2) if ustrregexm(wahllokal,"([^0-9]+)[\.]?([\w-]+)")

.         lab var nummer_wl "PP address number cleaned for geocoding"

.         
.         // drop the letters in cases of 5A etc. ; and keep only first number in cases of 2-4
.         replace nummer_wl = ustrregexs(1) if ustrregexm(nummer_wl,"(^[0-9]+)")
(15 real changes made)

.         
. * Harmonize street name to create PP identifier
.         gen     tmp = strasse_wl

.         harmon_street tmp 
(0 real changes made)
(0 real changes made)
(0 real changes made)
(664 real changes made)
(108 real changes made)
(0 real changes made)
(1 real change made)
(22 real changes made)
(14 real changes made)
(23 real changes made)
(46 real changes made)

. 
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp* wahllokal

. 
. *save: Assignments of precinct to polling places in BTW09
.         save `wl_btw09'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000001.tmp saved as .dta format

. 
. * KEEP distinct polling places for geocoding 
.         keep wahllokal_id strasse_wl nummer_wl

.         // keep unique polling locations
.         duplicates drop wahllokal_id, force

Duplicates in terms of wahllokal_id

(462 observations deleted)

.         
.         // save: unique PP
.         save `wl_btw09_uq'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000008.tmp saved as .dta format

.         
.         
. *--------------------*
. **** Import BTW13 ****
. *--------------------*
.         import excel  "$rawdata/election_office/polling_places/BTW_2013_Wahllokalverzeichnis.xls
> x", sheet(Table 1) firstrow clear
(5 vars, 205 obs)

.         ren     wahlbezirk sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         ren     gebaeudebeschreibung wahllokal_type 

.         lab var wahllokal_type "raw polling place type (from electoral office)"

.         ren     strasse strasse_wl

.         lab var strasse_wl "PP street name cleaned for geocoding"

.         ren     nummer  nummer_wl

.         lab var nummer_wl "PP address number cleaned for geocoding"

.         
.         drop    adresse_wahllokal

. 
. *Clean street names for geocoding
.         replace strasse_wl = subinstr(strasse_wl,"Pfanzeltpl. 5","Pfanzeltplatz",.)
(1 real change made)

.         replace nummer_wl = subinstr(nummer_wl,"a","5a",.) if strasse_wl=="Pfanzeltplatz"
(1 real change made)

.         
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(2 real changes made)
(1 real change made)
(2 real changes made)
(1 real change made)
(10 real changes made)
(6 real changes made)
(0 real changes made)
(168 real changes made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

.         
. * Drop letters in street number for geocoding
.         // drop the letters in cases of 5A
.         replace nummer_wl = ustrregexs(1) if ustrregexm(nummer_wl,"(^[0-9]+)")
(1 real change made)

.         // assert all number as real numbers
.         assert real(nummer_wl)!=.

.         
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(31 real changes made)
(205 real changes made)
(41 real changes made)
(0 real changes made)
(0 real changes made)
(6 real changes made)
(4 real changes made)
(8 real changes made)
(11 real changes made)

. 
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

.         
. *save: Assignments of precincts to polling locations in btw13
.         save `wl_btw13'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000002.tmp saved as .dta format

. 
. * KEEP unique polling locations for geocoding 
.         keep                    wahllokal_id strasse_wl nummer_wl

.         duplicates drop wahllokal_id, force

Duplicates in terms of wahllokal_id

(8 observations deleted)

.         save `wl_btw13_uq'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000009.tmp saved as .dta format

. 
. *--------------------*
. **** Import KOW14 ****
. *--------------------*
.         import excel  "$rawdata/election_office/polling_places/KommW_2014_Wahllokalverzeichnis.x
> lsx", sheet(Table 1) firstrow clear
(4 vars, 205 obs)

.         rename  Wahllokalnummer sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         rename  Strasse strasse_wl

.         lab var strasse_wl "PP street cleaned for geocoding"

.         rename  Nr nummer_wl

.         lab var nummer_wl "PP address number cleaned for geocoding"

.         rename  Wahllokalname wahllokal_type

.         lab var wahllokal_type "raw polling place type (from electoral office)"

.         
. 
. *Change street names for geocoding
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(2 real changes made)
(0 real changes made)
(2 real changes made)
(2 real changes made)
(9 real changes made)
(6 real changes made)
(1 real change made)
(168 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. *number to string
.         tostring nummer_wl, replace
nummer_wl was int now str3

.         
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(30 real changes made)
(205 real changes made)
(41 real changes made)
(0 real changes made)
(0 real changes made)
(6 real changes made)
(4 real changes made)
(8 real changes made)
(11 real changes made)

. 
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

.                 
. *save: Correspondence of PP to precinct 
.         save `wl_kow14'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000003.tmp saved as .dta format

. 
. * KEEP unique PP for geocoding 
.         keep                    wahllokal_id strasse_wl nummer_wl

.         duplicates drop wahllokal_id, force

Duplicates in terms of wahllokal_id

(8 observations deleted)

.         // save
.         save `wl_kow14_uq'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000a.tmp saved as .dta format

. 
.         
. *--------------------*
. **** Import BTW17 ****
. *--------------------*
. 
.         import excel  "$rawdata/election_office/polling_places/BTW_2017_Wahllokalverzeichnis.xls
> x", sheet(Table 1) firstrow clear
(4 vars, 224 obs)

.         ren     Wahllokalnummer sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         ren     Strasse strasse_wl

.         lab var strasse_wl "PP street cleaned for geocoding"

.         ren     Nr nummer_wl

.         lab var nummer_wl "PP address number"

.         ren     Wahllokalname wahllokal_type

.         lab var wahllokal_type "raw polling place type (from electoral office)"

. 
. *Change street names for geocoding
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(2 real changes made)
(2 real changes made)
(0 real changes made)
(1 real change made)
(1 real change made)
(181 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. *number to string
.         tostring nummer_wl, replace
nummer_wl was int now str3

.         
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(33 real changes made)
(224 real changes made)
(40 real changes made)
(0 real changes made)
(0 real changes made)
(4 real changes made)
(4 real changes made)
(8 real changes made)
(12 real changes made)

. 
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

.         
. *save: correspondence of precincts to PP
.         save `wl_btw17'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format

. 
. * KEEP unique PP for geocoding
.         keep wahllokal_id strasse_wl nummer_wl

.         order wahllokal_id strasse_wl nummer_wl

.         duplicates drop wahllokal_id, force 

Duplicates in terms of wahllokal_id

(4 observations deleted)

.         // save
.         save `wl_btw17_uq'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000b.tmp saved as .dta format

. 
. *--------------------*
. **** Import LTW18 ****
. *--------------------*
.         import excel  "$rawdata/election_office/polling_places/LTW_2018_Wahllokalverzeichnis.xls
> x", sheet(Table 1) firstrow clear
(4 vars, 214 obs)

.         
.         ren     Wahllokalnummer sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         ren     Strasse strasse_wl

.         lab var strasse_wl "PP street cleaned for geocoding"

.         ren     Nr nummer_wl

.         lab var nummer_wl "PP address number"

.         ren     Wahllokalname wahllokal_type

.         lab var wahllokal_type "raw polling place type (from electoral office)" 

.         
. *Change street names for geocoding
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(2 real changes made)
(2 real changes made)
(1 real change made)
(1 real change made)
(1 real change made)
(173 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. *number to string
.         tostring nummer_wl, replace
nummer_wl was int now str3

. 
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(33 real changes made)
(214 real changes made)
(42 real changes made)
(0 real changes made)
(0 real changes made)
(4 real changes made)
(4 real changes made)
(8 real changes made)
(12 real changes made)

.         
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

.         
. *save: correspondence of precincts to PP
.         save `wl_ltw18'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000005.tmp saved as .dta format

. 
. * KEEP unique PP for geocoding
.         keep wahllokal_id strasse_wl nummer_wl

. 
.         duplicates drop wahllokal_id, force 

Duplicates in terms of wahllokal_id

(2 observations deleted)

.         // save
.         save `wl_ltw18_uq'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000c.tmp saved as .dta format

. 
. *--------------------*
. **** Import EUW19 ****
. *--------------------*
.         import excel  "$rawdata/election_office/polling_places/EuW_2019_Wahllokalverzeichnis.xls
> x", sheet(Table 1) firstrow clear
(4 vars, 207 obs)

.         
.         ren     Wahllokalnummer sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         ren     Strasse strasse_wl

.         lab var strasse_wl "PP street cleaned for geocoding"

.         ren     Nr nummer_wl

.         lab var nummer_wl "PP address number"

.         ren     Wahllokalname wahllokal_type

.         lab var wahllokal_type "raw polling place type (from electoral office)" 

. 
. *Change street names for geocoding
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
variable strasse_wl was str24 now str25
(1 real change made)
(1 real change made)
(166 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. *number to string
.         tostring nummer_wl, replace
nummer_wl was int now str3

.         
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(31 real changes made)
(207 real changes made)
(40 real changes made)
(0 real changes made)
(0 real changes made)
(4 real changes made)
(4 real changes made)
(8 real changes made)
(13 real changes made)

.         
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

.         
. *save: correspondence of precincts to polling locations
.         save `wl_euw19'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000006.tmp saved as .dta format

. 
. * KEEP unique PP for geocoding
.         keep wahllokal_id strasse_wl nummer_wl

.         duplicates drop wahllokal_id, force 

Duplicates in terms of wahllokal_id

(3 observations deleted)

.         // save
.         save `wl_euw19_uq'      
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000d.tmp saved as .dta format

.         
. 
. *--------------------*
. **** Import KOW20 ****
. *--------------------*
.         import excel  "$rawdata/election_office/polling_places/KommW_2020_Wahllokalverzeichnis.x
> lsx", sheet(Table 1) firstrow clear
(4 vars, 226 obs)

.         
.         ren     Wahllokalnummer sb_all

.         lab var sb_all "(List of) Precinct ID(s)"

.         ren     Strasse strasse_wl

.         lab var strasse_wl "PP street cleaned for geocoding"

.         ren     Nr nummer_wl

.         lab var nummer_wl "PP address number"

.         ren     Wahllokalname wahllokal_type

.         lab var wahllokal_type "raw polling place type (from electoral office)"

. 
. 
. *Change street names for geocoding
.         clean_streetname strasse_wl
(0 real changes made)
(0 real changes made)
(2 real changes made)
(0 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
variable strasse_wl was str24 now str25
(1 real change made)
(4 real changes made)
(183 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
variable strasse_wl was str25 now str26
(2 real changes made)
variable strasse_wl was str26 now str31
(1 real change made)
(0 real changes made)

. 
. *number to string
.         tostring nummer_wl, replace
nummer_wl was int now str3

.         
. * Harmonize street name for PP identifier 
.         gen     tmp = strasse_wl

.         harmon_street tmp
(0 real changes made)
(0 real changes made)
(35 real changes made)
(226 real changes made)
(45 real changes made)
(0 real changes made)
(0 real changes made)
(10 real changes made)
(4 real changes made)
(7 real changes made)
(12 real changes made)

.         
. * Gen wahllokal_id := PP identifier = street + number   
.         gen             wahllokal_id = tmp + nummer_wl

.         lab var wahllokal_id "raw PP ID (string)"

.         drop tmp*

. 
. *save: correspondence of precinct to polling locations
.         save `wl_kow20' 
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000007.tmp saved as .dta format

. 
. * KEEP unique PP for geocoding
.         keep wahllokal_id strasse_wl nummer_wl

.         duplicates drop wahllokal_id, force 

Duplicates in terms of wahllokal_id

(5 observations deleted)

.         // save
.         save `wl_kow20_uq'      
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000e.tmp saved as .dta format

.         
.         
.         
. /* 2. MERGE UNIQUE PP to obtain list polling locations across all elections for geocoding */
.  use  `wl_btw13_uq', clear      

.  
.         merge 1:1 wahllokal_id using `wl_kow14_uq', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                            10
        from master                         5  
        from using                          5  

    Matched                               192  
    -----------------------------------------

.         merge 1:1 wahllokal_id using `wl_btw17_uq', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                           114
        from master                        48  
        from using                         66  

    Matched                               154  
    -----------------------------------------

.         merge 1:1 wahllokal_id using `wl_ltw18_uq', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                            64
        from master                        60  
        from using                          4  

    Matched                               208  
    -----------------------------------------

.         merge 1:1 wahllokal_id using `wl_euw19_uq', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                            78
        from master                        73  
        from using                          5  

    Matched                               199  
    -----------------------------------------

.         merge 1:1 wahllokal_id using `wl_kow20_uq', nogen
(variable strasse_wl was str26, now str31 to accommodate using data's values)
(variable wahllokal_id was str25, now str29 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                           112
        from master                        84  
        from using                         28  

    Matched                               193  
    -----------------------------------------

.         merge 1:1 wahllokal_id using `wl_btw09_uq', nogen 

    Result                      Number of obs
    -----------------------------------------
    Not matched                           119
        from master                       111  
        from using                          8  

    Matched                               194  
    -----------------------------------------

.         
.         // SAVE: list of UNIQUE PP across all elections for geocoding
.         save "$tmp/wl_unique.dta", replace
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_unique.dta not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_unique.dta saved

. 
. 
. /* 3. CLEAN assignments of pp to precincts & APPEND PP across elections   */    
. tempfile wl_btw09_cl wl_btw13_cl wl_ltw13_cl wl_kow14_cl wl_euw14_cl wl_btw17_cl wl_ltw18_cl wl_
> euw19_cl wl_kow20_cl

.         
. foreach election in "btw09" "btw13" "kow14" "btw17" "ltw18" "euw19" "kow20" {
  2. 
.  * Pull: correspondence of precinct to polling places
.         use `wl_`election'', clear
  3.         drop strasse_wl nummer_wl
  4.                 
.  * In most years sb_all contains a list of precincts assigned to one PP, e.g., "1901, 1902, 1903
> "
.  *       => expand this list so that each precinct has its own row
.         
.         // split precincts in separate variables (help1 help2 ...)
.         gen tmp_list = ustrregexra(sb_all,"[\s+]?\,[\s+]?"," ")
  5.         split tmp_list, p(" ") gen(help)
  6.         
.         // extract how many distinct precincts per PP 
.         destring help*, replace
  7.         egen help_distinct=rownonmiss(help*)
  8.         
.         // gen counter for each entry (wahllokal_id does not uniquely id obs)
.         gen tmp_id = _n
  9. 
.         // produce #copies of each PP equal to #of precincts
.         expand help_distinct 
 10.         
.         // gen sb := precinct ID, and populate variable 
.         gen     sb=. 
 11.         lab var sb "Precinct ID"
 12.         qui su help_distinct
 13.         forvalues j = 1/`r(max)' {
 14.                 bys tmp_id: replace sb= help`j' if _n==`j'
 15.         }
 16.         drop tmp* help*
 17.         // Assert: no missings & not ambiguous mappings of precincts to PP
.         assert !missing(sb)
 18.         isid sb
 19. 
.         drop sb_all
 20. 
. * save
.         isid wahllokal_id sb
 21.         save `wl_`election'_cl'
 22. 
. * Assignments of LTW13 = BTW13 and EU14 = KOW14 => save 
.         if "`election'" == "btw13" {
 23.         save `wl_ltw13_cl'
 24.         }
 25.         else if "`election'" == "kow14" {
 26.         save `wl_euw14_cl'
 27.         }
 28. }
variable created as string: 
help1
help1: all characters numeric; replaced as int
(0 observations created)
(664 missing values generated)
(664 real changes made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000n.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8  help9
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(21 missing values generated)
help3: all characters numeric; replaced as int
(64 missing values generated)
help4: all characters numeric; replaced as int
(114 missing values generated)
help5: all characters numeric; replaced as int
(162 missing values generated)
help6: all characters numeric; replaced as int
(186 missing values generated)
help7: all characters numeric; replaced as int
(193 missing values generated)
help8: all characters numeric; replaced as int
(199 missing values generated)
help9: all characters numeric; replaced as int
(204 missing values generated)
(497 observations created)
(702 missing values generated)
(205 real changes made)
(184 real changes made)
(141 real changes made)
(91 real changes made)
(43 real changes made)
(19 real changes made)
(12 real changes made)
(6 real changes made)
(1 real change made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000o.tmp saved as .dta format
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000p.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8  help9
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(21 missing values generated)
help3: all characters numeric; replaced as int
(65 missing values generated)
help4: all characters numeric; replaced as int
(113 missing values generated)
help5: all characters numeric; replaced as int
(162 missing values generated)
help6: all characters numeric; replaced as int
(186 missing values generated)
help7: all characters numeric; replaced as int
(193 missing values generated)
help8: all characters numeric; replaced as int
(199 missing values generated)
help9: all characters numeric; replaced as int
(204 missing values generated)
(497 observations created)
(702 missing values generated)
(205 real changes made)
(184 real changes made)
(140 real changes made)
(92 real changes made)
(43 real changes made)
(19 real changes made)
(12 real changes made)
(6 real changes made)
(1 real change made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000q.tmp saved as .dta format
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000r.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(50 missing values generated)
help3: all characters numeric; replaced as int
(113 missing values generated)
help4: all characters numeric; replaced as int
(169 missing values generated)
help5: all characters numeric; replaced as int
(198 missing values generated)
help6: all characters numeric; replaced as int
(207 missing values generated)
help7: all characters numeric; replaced as int
(216 missing values generated)
help8: all characters numeric; replaced as int
(222 missing values generated)
(393 observations created)
(617 missing values generated)
(224 real changes made)
(174 real changes made)
(111 real changes made)
(55 real changes made)
(26 real changes made)
(17 real changes made)
(8 real changes made)
(2 real changes made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000s.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(37 missing values generated)
help3: all characters numeric; replaced as int
(96 missing values generated)
help4: all characters numeric; replaced as int
(156 missing values generated)
help5: all characters numeric; replaced as int
(188 missing values generated)
help6: all characters numeric; replaced as int
(198 missing values generated)
help7: all characters numeric; replaced as int
(207 missing values generated)
help8: all characters numeric; replaced as int
(212 missing values generated)
(404 observations created)
(618 missing values generated)
(214 real changes made)
(177 real changes made)
(118 real changes made)
(58 real changes made)
(26 real changes made)
(16 real changes made)
(7 real changes made)
(2 real changes made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000t.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(35 missing values generated)
help3: all characters numeric; replaced as int
(87 missing values generated)
help4: all characters numeric; replaced as int
(147 missing values generated)
help5: all characters numeric; replaced as int
(176 missing values generated)
help6: all characters numeric; replaced as int
(190 missing values generated)
help7: all characters numeric; replaced as int
(199 missing values generated)
help8: all characters numeric; replaced as int
(204 missing values generated)
(411 observations created)
(618 missing values generated)
(207 real changes made)
(172 real changes made)
(120 real changes made)
(60 real changes made)
(31 real changes made)
(17 real changes made)
(8 real changes made)
(3 real changes made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000u.tmp saved as .dta format
variables created as string: 
help1  help2  help3  help4  help5  help6  help7  help8  help9
help1: all characters numeric; replaced as int
help2: all characters numeric; replaced as int
(26 missing values generated)
help3: all characters numeric; replaced as int
(83 missing values generated)
help4: all characters numeric; replaced as int
(137 missing values generated)
help5: all characters numeric; replaced as int
(173 missing values generated)
help6: all characters numeric; replaced as int
(201 missing values generated)
help7: all characters numeric; replaced as int
(214 missing values generated)
help8: all characters numeric; replaced as int
(220 missing values generated)
help9: all characters numeric; replaced as int
(225 missing values generated)
(529 observations created)
(755 missing values generated)
(226 real changes made)
(200 real changes made)
(143 real changes made)
(89 real changes made)
(53 real changes made)
(25 real changes made)
(12 real changes made)
(6 real changes made)
(1 real change made)
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_00000v.tmp saved as .dta format

. 
.  ** APPEND
.  clear 

.  gen wahl =""

.  gen wahl_id = .

.  lab var wahl "Election ID (string)"

.  lab var wahl_id "Election ID (num)"

.  local j=0

. /* loop over elections in chronological order */
. foreach election in "btw09" "ltw13" "btw13" "kow14" "euw14" "btw17" "ltw18" "euw19" "kow20" {   
  2.         append using `wl_`election'_cl'
  3.         replace wahl = upper("`election'") if missing(wahl)
  4.         replace wahl_id= `j' if missing(wahl_id)
  5.         local ++j
  6. }
variable wahl was str1 now str5
(664 real changes made)
(664 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(702 real changes made)
(617 real changes made)
(617 real changes made)
(618 real changes made)
(618 real changes made)
(618 real changes made)
(618 real changes made)
(variable wahllokal_id was str25, now str29 to accommodate using data's values)
(755 real changes made)
(755 real changes made)

.         labmask wahl_id, values(wahl)

. 
. ** SAVE: Assignments of PP to precincts across all elections (w/o geocodes)
. save "$tmp/wl_sb_assignments_raw", replace
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_sb_assignments_raw.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_sb_assignments_raw.dta
    saved

. 
. 
.  
. 
end of do-file
Running: 06_geocode_polling_stations.do

. /*
> 
> Input: tmp/wl_unique.dta [list of unique pollling locations with address]
> 
> Output: tmp/wl_unique_geocoded.dta [polling locations with geocodes]
> 
> Main task:
>         > merge preprocessed geocodes of polling locations from 
>                 03_geocoded_addresses/wl_addresses_geocoded.dta
>         
>         OR
>         
>         Geolocate polling locations yourself (see details in do-file 03_geocode_ltw18.do)
>          
>         To replicate the geocoding you need an API key from OpenCage and we recommend
>                 purchasing a request quota from OpenCage to accelarate the geocoding.
>         See OpenCage for details: https://opencagedata.com/tutorials/geocode-in-stata
> 
>         If you want re-run the geocoding yourself set the global RERUN_GEOCODE_PP to 1 
>                 in _master.do and provide your API key.
>                 
>         Otherwise, this dofile simply merges our geo-coordinates 
>                 03_geocoded_addresses/wl_addresses_geocoded.dta
>         to the list of unique polling locations.
> 
> */
. 
.  ** PULL: List of unique polling locations (across all elections)
.  use "$tmp/wl_unique.dta", clear

.   
.  if $RERUN_GEOCODE_PP ==0 {
.         
.         // MERGE geocodes to polling locations 
.         merge m:1 wahllokal_id using "$geocod/wl_addresses_geocoded.dta", assert(3) nogen
(variable wahllokal_id was str29, now str31 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               313  
    -----------------------------------------
.         
.         // save
.         save "$tmp/wl_unique_geocoded.dta", replace
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_unique_geocoded.dta
    not found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_unique_geocoded.dta
    saved
.  }

.  else if $RERUN_GEOCODE_PP ==1 {
. 
.         // gen city name
.         gen stadt = "München"
. 
.         opencagegeo , key($api_key) countrycode(de) language(de) ///
>                                   city(stadt) street(strasse_wl) number(nummer_wl) 
. 
. 
.         /* OUTPUT:
> 
>         OpenCage geocoded 313 of 313
> 
>           g_quality |      Freq.     Percent        Cum.
>         ------------+-----------------------------------
>            6 street |          8        2.56        2.56 --> 8 instances where only street was f
> ound!
>            7 number |        305       97.44      100.00
>         ------------+-----------------------------------
>                   Total |        313      100.00
> 
>         */
. 
.         
.         ** Manually correct instances where only street (but not address nbr) was identified (g_
> quality=6)
.         
.         replace g_lat = "48.128493" if wahllokal_id=="bergamlaimstrasse140"                     
.         replace g_lon = "11.628849" if wahllokal_id=="bergamlaimstrasse140"
. 
.         replace g_lat = "48.153949" if wahllokal_id=="schwindstrasse19"
.         replace g_lon = "11.563719" if wahllokal_id=="schwindstrasse19"
. 
.         replace g_lat = "48.169498" if wahllokal_id=="freseniusstrasse45"
.         replace g_lon = "11.476888" if wahllokal_id=="freseniusstrasse45"
. 
.         replace g_lat = "48.1826237" if wahllokal_id=="schleissheimerstrasse336"                
.         replace g_lon = "11.5671737" if wahllokal_id=="schleissheimerstrasse336"
. 
.         replace g_lat = "48.1408276" if wahllokal_id=="hildegardhammbruecherstrasse5"
.         replace g_lon = "11.4062949" if wahllokal_id=="hildegardhammbruecherstrasse5"  
. 
.         replace g_lat = "48.207662" if wahllokal_id=="eduardsprangerstrasse46"
.         replace g_lon = "11.550730" if wahllokal_id=="eduardsprangerstrasse46"
. 
.         replace g_lat = "48.112215" if wahllokal_id=="karwendelstrasse39"
.         replace g_lon = "11.537259" if wahllokal_id=="karwendelstrasse39"
. 
.         replace g_lat = "48.180676" if wahllokal_id=="untermenzingerstrasse1"
.         replace g_lon = "11.505364" if wahllokal_id=="untermenzingerstrasse1"
.         
.     ** In one instance OpenCage identifies Schulstrasse 8 in wrong postcode (correct plz: 85757,
>  wrong plz:80634)
.         replace g_lat="48.21721" if wahllokal_id=="schulstrasse8"
.         replace g_lon="11.46115" if wahllokal_id=="schulstrasse8"       
. 
.         // save: geocoded PP addresses
.         drop nummer_wl strasse_wl stadt
.         save "$tmp/wl_unique_geocoded.dta", replace
.         
.  }      

.         
. 
end of do-file
Running: 07_correction_polling_stations.do

. /*
> Input: $tmp/wl_sb_assignments_raw [Polling location - precinct assignments across all elections]
> 
> Output: $tmp/wl_sb_assignments_clean.dta
> 
> Tasks:
>         Merge geocodes
>         Harmonize polling place (PP) identifier, e.g. when same type (e.g., "Grundschule") but s
> lightly different address
>                 > also adjust geocodes accordingly (take always the geocode from the first occur
> ance)
>                         wahllokal_id := Raw-identifier of PP based on reported address
>         GEN:    wl_id := harmonized PP identifier used in final dataset
>         GEN:    wl_typ:= harmonized PP description used in final dataset
> 
> */
. 
. *** 1) Harmonize Polling place IDs and description across different elections
. *       This create as list of unique PP (wahllokal_id) and their harmonized ID (wl_id)
. // E.g., "Alten- und Servicezentrum Haidhausen" has address Wolfgangstr. 15 in SE-18 and Wolfgan
> gstr. 18 in FE-17 => but same building
. 
. ** PULL: Polling location x precinct x election  
. use "$tmp/wl_sb_assignments_raw", clear

.         isid wahl_id sb

. 
.  * MERGE PP geocodes 
.         merge m:1 wahllokal_id using "$tmp/wl_unique_geocoded.dta", assert(3) nogen
(variable wahllokal_id was str29, now str31 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                             6,080  
    -----------------------------------------

.         isid wahl_id sb

.         // rename geocodes and drop redundant variables from geocoding
.         ren             g_lat   lat_wl

.         lab var         lat_wl  "latitude of polling location"

.         ren             g_lon   lon_wl

.         lab var         lon_wl  "longitude of polling location"

.         destring        lat_wl  lon_wl, replace
lat_wl: all characters numeric; replaced as double
lon_wl: all characters numeric; replaced as double

.         drop g_*

. 
.  * HARMONIZE wahllokal_type across elections; gen wl_type
.         gen     tmp_len = strlen(wahllokal_type) // use most detailed description

.         bys     wahllokal_id (tmp_len wahllokal_type): gen wl_typ = wahllokal_type[_N]

.         lab var wl_typ "Description of PP (harmonized over different elections)"

.         drop tmp*

.         
.  * KEEP unique polling place IN EACH ELECTION
.         duplicates drop wahl_id wahllokal_id, force     

Duplicates in terms of wahl_id wahllokal_id

(4,233 observations deleted)

.         drop sb wahllokal_type

. 
.  *** HARMONIZE polling place ID across elections: gen wl_id
.         gen     wl_id = wahllokal_id

.         lab var wl_id            "Harmonized PP ID"

.         lab var wahllokal_id "Raw ID of PP based on reported address"

. 
.         // keep UNIQUE polling places (from official data)
.         isid wahllokal_id wahl_id

.         bys wahllokal_id (wahl_id): keep if _n==1 // keep earliest election
(1,534 observations deleted)

. 
.         // Manual adjustments in cases where PP has same description but slightly different addr
> ess
.         // E.g., Alten- und Servicezentrum Haidhausen has address Wolfgangstr. 15 in LTW18 and W
> olfgangstr. 18 in BTW17 => but same building
. 
.         replace wl_id="wolfgangstrasse15"               if wl_id=="wolfgangstrasse18"
(1 real change made)

.         replace wl_id="freseniusstrasse45"              if wl_id=="freseniusstrasse47"
(1 real change made)

.         replace wl_id="grandlstrasse5"                  if wl_id=="grandlstrasse12"
(1 real change made)

.         replace wl_id="barlachstrasse26"                if wl_id=="barlachstrasse28"
(1 real change made)

. 
.         replace wl_id="bergamlaimstrasse140"    if wl_id=="bergamlaimstrasse142"
(1 real change made)

.         replace wl_id="dieselstrasse12"                 if wl_id=="dieselstrasse14"
(1 real change made)

.         replace wl_id="dompedroplatz2"                  if wl_id=="dompedroplatz5"
(1 real change made)

.         replace wl_id="eduardsprangerstrasse15" if wl_id=="eduardsprangerstrasse17"
(1 real change made)

.         replace wl_id="forellenstrasse1"                if wl_id=="forellenstrasse5"
(1 real change made)

.         replace wl_id="musenbergstrasse30"              if wl_id=="musenbergstrasse32"
(1 real change made)

.         replace wl_id="pfanzeltplatz5"                  if wl_id=="pfanzeltplatz10"
(1 real change made)

.         replace wl_id="sanktannastrasse20"              if wl_id=="sanktannastrasse22"
(1 real change made)

. 
.         replace wl_id="markgrafenstrasse33"     if wl_id=="markgrafenstrasse31"
(1 real change made)

.         replace wl_id="engelhardstrasse26"              if wl_id=="karwendelstrasse39"
(1 real change made)

.                  
.         * Harmonize geocoordinates (always take the one from the earliest election)
.         bys wl_id (wahl_id wahllokal_id): replace wl_typ = wl_typ[1]
(10 real changes made)

.         bys wl_id (wahl_id wahllokal_id): replace lat_wl = lat_wl[1]
(14 real changes made)

.         bys wl_id (wahl_id wahllokal_id): replace lon_wl = lon_wl[1]
(14 real changes made)

.         
.         drop wahl_id wahl 

.         isid wahllokal_id

. 
.  ** MERGE back to full PP-precinct assignment 
.         merge 1:m wahllokal_id using "$tmp/wl_sb_assignments_raw.dta", assert(3) nogen
(label wahl_id already defined)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                             6,080  
    -----------------------------------------

.         
.         // DROP redundant PP ID Raw PP description (KEEP harmonized id: wl_id)  
.         drop  wahllokal_id wahllokal_type

.         
.         // DROP other redundtant PP variables 
.         drop strasse_wl nummer_wl

.         
.  * SAVE: Correspondence of (harmonized) PP ID to precinct across elections
.         compress 
  variable wahl_id was float now byte
  variable sb was float now int
  (30,400 bytes saved)

.         order sb wl_id wahl_id wahl  

.         isid sb wahl_id 

.         save "$tmp/wl_sb_assignments_clean.dta", replace
(file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_sb_assignments_clean.dta
    not found)
file
    //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/wl_sb_assignments_clean.dta
    saved

. 
end of do-file
Running: 08_merge_voter_polling_stations.do

. /*
> Input: tmp/voter_id_panel_raw.dta [balanced panel of voter-addresses]
>         
> Output: tmp/voter_id_panel.dta [voter-addresses with added polling places]
> 
> Main task:
>         > merge address panel with info on polling locations 
> 
> */
. 
. * PULL: balanced voter-address panel 
.         use "$tmp/voter_id_panel_raw.dta", clear 

.         
.         
.  ** MERGE polling locations to precincts
.         merge m:1 sb wahl_id using "$tmp/wl_sb_assignments_clean.dta", assert(3) nogen
(label wahl_id already defined)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                         1,357,011  
    -----------------------------------------

.         
.         
. *SAVE: balanced panel of geocoded voter-addresses + assigned (geocod.) polling locations
.         order voter_id wahl* sb stadtbez lat_vote lon_vote wl_id lat_wl lon_wl

.         isid voter_id wahl_id

.         compress        
  variable wahl_id was float now byte
  (4,071,033 bytes saved)

.         save "$tmp/voter_id_panel.dta", replace
(file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_id_panel.dta not
    found)
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/tmp/voter_id_panel.dta saved

. 
end of do-file
Running: 09_export_for_arcgis.do

. /*
> Input: tmp/voter_id_panel.dta [address - precinct assignments + geocodes of addresses and pollin
> g locations]
>         
> Output: voter and polling location files with geocodes
> 
> Main task: export .txt with geo-coordinates for maps
> 
> */
. 
. * PULL: data containing address - precinct assignments + geocodes of addresses and polling locat
> ions 
. use "$tmp/voter_id_panel.dta", clear

. 
. ***Figure 2
. preserve

. *voter: addresses and assigned polling places
.         keep if wahl_id==6
(1,206,232 observations deleted)

.         bys voter_id_str: assert _N==1

.         keep voter_id_str lat_vote lon_vote lat_wl lon_wl

.         export delim "$rawdata/shp/shapes_fig2/voter18.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig2/voter
> 18.txt saved

. restore

. 
. preserve

. *polling places: addresses
.         keep if wahl_id==6
(1,206,232 observations deleted)

.         keep wl_id lat_wl lon_wl

.         bys wl_id: keep if _n==1
(150,568 observations deleted)

.         export delim "$rawdata/shp/shapes_fig2/wl18.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig2/wl18.
> txt saved

. restore

. 
. 
. ***Figure 3a
. preserve

. *voter: 2017
.         tempfile voter17_806

.         keep if wahl_id==5 & sb==806
(1,356,918 observations deleted)

.         bys voter_id_str: assert _N==1

.         keep voter_id_str lat_vote lon_vote lat_wl lon_wl

.         export delim "$rawdata/shp/shapes_fig3a/voter17_806.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3a/vote
> r17_806.txt saved

.         keep voter_id_str

.         save `voter17_806'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000004.tmp saved as .dta format

. restore

. 
. preserve

. *voter: 2014
.         keep if wahl_id==4
(1,206,232 observations deleted)

.         merge 1:1 voter_id_str using `voter17_806', assert(1 3) keep(3) nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                                93  
    -----------------------------------------

.         bys voter_id_str: assert _N==1

.         keep voter_id_str lat_vote lon_vote lat_wl lon_wl

.         export delim "$rawdata/shp/shapes_fig3a/voter14_806.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3a/vote
> r14_806.txt saved

. restore

. 
. 
. preserve

. *polling places: 2014
.         keep if wahl_id==4 & (wl_id=="theresienhoehe15" | wl_id=="ridlerstrasse26")
(1,356,393 observations deleted)

.         keep wl_id lat_wl lon_wl

.         bys wl_id: keep if _n==1
(616 observations deleted)

.         export delim "$rawdata/shp/shapes_fig3a/wl14_806.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3a/wl14
> _806.txt saved

. restore

. 
. preserve

. *polling places: 2017
.         keep if wahl_id==5 & wl_id=="ridlerstrasse26"
(1,356,701 observations deleted)

.         keep wl_id lat_wl lon_wl

.         bys wl_id: keep if _n==1
(309 observations deleted)

.         export delim "$rawdata/shp/shapes_fig3a/wl17_806.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3a/wl17
> _806.txt saved

. restore

. 
. 
. ***Figure 3b
. preserve

. *voter: 2017
.         tempfile voter17_612

.         keep if wahl_id==5 & sb==612
(1,356,898 observations deleted)

.         bys voter_id_str: assert _N==1

.         keep voter_id_str lat_vote lon_vote lat_wl lon_wl

.         export delim "$rawdata/shp/shapes_fig3b/voter17_612.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3b/vote
> r17_612.txt saved

.         keep voter_id_str

.         save `voter17_612'
file C:\Users\Alipour\AppData\Local\Temp\9\ST_77c8_000009.tmp saved as .dta format

. restore

. 
. preserve

. *voter: 2014
.         keep if wahl_id==4
(1,206,232 observations deleted)

.         merge 1:1 voter_id_str using `voter17_612', assert(1 3) keep(3) nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               113  
    -----------------------------------------

.         tab wl_id

             Harmonized PP ID |      Freq.     Percent        Cum.
------------------------------+-----------------------------------
              gotzingerplatz1 |        113      100.00      100.00
------------------------------+-----------------------------------
                        Total |        113      100.00

.         bys voter_id_str: assert _N==1

.         keep voter_id_str lat_vote lon_vote lat_wl lon_wl

.         export delim "$rawdata/shp/shapes_fig3b/voter14_612.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3b/vote
> r14_612.txt saved

. restore

. 
. 
. 
. preserve

. *polling places: 2014
.         keep if wahl_id==4 & (wl_id=="gotzingerplatz1" | wl_id=="wackersbergerstrasse59")
(1,356,157 observations deleted)

.         keep wl_id lat_wl lon_wl

.         bys wl_id: keep if _n==1
(852 observations deleted)

.         export delim "$rawdata/shp/shapes_fig3b/wl14_612.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3b/wl14
> _612.txt saved

. restore

. 
. preserve

. *polling places: 2017
.         keep if wahl_id==5 & (wl_id=="gotzingerplatz1" | wl_id=="wackersbergerstrasse59")
(1,356,381 observations deleted)

.         keep wl_id lat_wl lon_wl

.         bys wl_id: keep if _n==1
(628 observations deleted)

.         export delim "$rawdata/shp/shapes_fig3b/wl17_612.txt", replace
file //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/02_rawdata/shp/shapes_fig3b/wl17
> _612.txt saved

. restore

. 
end of do-file

.         log close 
      name:  <unnamed>
       log:  //vmpfs-int/ag-int$/05_Forschungsprojekte/voting/Replication/07_output/logs/1_prep_an
> d_geolocate_addresses.log
  log type:  text
 closed on:   3 Mar 2024, 11:22:43
--------------------------------------------------------------------------------------------------
